From 3cef44886d25703b3acbf58aaf76e9e9656ca809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Feb 2021 16:39:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Annotation/Annotation.php | 14 +++++++------- Database/DatabasesProviders.php | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Annotation/Annotation.php b/Annotation/Annotation.php index f6becad3..a79e1e24 100644 --- a/Annotation/Annotation.php +++ b/Annotation/Annotation.php @@ -34,7 +34,7 @@ class Annotation extends Component private array $_methods = []; - private array $_prepertyes = []; + private array $_properties = []; /** @@ -150,8 +150,8 @@ class Annotation extends Component private function resolveProperty(ReflectionClass $reflectionClass, $object) { $property = $reflectionClass->getProperties(); - if (!isset($this->_prepertyes[get_class($object)])) { - $this->_prepertyes[get_class($object)] = []; + if (!isset($this->_properties[get_class($object)])) { + $this->_properties[get_class($object)] = []; } foreach ($property as $value) { if ($value->isStatic()) continue; @@ -166,7 +166,7 @@ class Annotation extends Component continue; } $annotation = $annotation->execute([$object, $value->getName()]); - $this->_prepertyes[get_class($object)][$value->getName()] = $annotation; + $this->_properties[get_class($object)][$value->getName()] = $annotation; if ($value->isPublic()) { continue; @@ -189,15 +189,15 @@ class Annotation extends Component if (is_object($class)) { $class = get_class($class); } - if (!isset($this->_prepertyes[$class])) { + if (!isset($this->_properties[$class])) { return null; } if (!empty($property)) { - return $this->_prepertyes[$class][$property] ?? null; + return $this->_properties[$class][$property] ?? null; } - return $this->_prepertyes[$class]; + return $this->_properties[$class]; } diff --git a/Database/DatabasesProviders.php b/Database/DatabasesProviders.php index 509530bb..fad0ccb7 100644 --- a/Database/DatabasesProviders.php +++ b/Database/DatabasesProviders.php @@ -37,7 +37,6 @@ class DatabasesProviders extends Providers $event->on(Event::SERVER_WORKER_START, [$this, 'createPool']); $event->on(Event::SERVER_TASK_START, [$this, 'createPool']); - $event->on(Event::SERVER_BEFORE_START, [$this, 'scanModel']); $event->on(Event::SERVER_WORKER_START, [$this, 'scanModel']); $event->on(Event::SERVER_TASK_START, [$this, 'scanModel']); }