This commit is contained in:
2021-02-23 15:02:35 +08:00
parent d63cdfa39a
commit 37b6170dba
3 changed files with 223 additions and 221 deletions
-1
View File
@@ -164,7 +164,6 @@ class Annotation extends Component
$object->{$value->getName()} = $annotation; $object->{$value->getName()} = $annotation;
} else { } else {
$name = 'set' . ucfirst($value->getName()); $name = 'set' . ucfirst($value->getName());
var_dump($name);
if (!method_exists($object, $name)) { if (!method_exists($object, $name)) {
throw new NotFindPropertyException('set property need method ' . $name); throw new NotFindPropertyException('set property need method ' . $name);
} }
+1 -1
View File
@@ -104,7 +104,7 @@ class Application extends BaseApplication
public function start(Input $argv): bool|string public function start(Input $argv): bool|string
{ {
try { try {
// $this->scan_system_annotation(); $this->scan_system_annotation();
fire(Event::SERVER_BEFORE_START); fire(Event::SERVER_BEFORE_START);
+3
View File
@@ -171,6 +171,9 @@ class Container extends BaseObject
private function resolveDependencies($class, $constrict = []): ?array private function resolveDependencies($class, $constrict = []): ?array
{ {
if (!isset($this->_reflection[$class])) { if (!isset($this->_reflection[$class])) {
if (!class_exists($class)) {
return null;
}
$reflection = new ReflectionClass($class); $reflection = new ReflectionClass($class);
if (!$reflection->isInstantiable()) { if (!$reflection->isInstantiable()) {
return null; return null;