qqq
This commit is contained in:
+20
-16
@@ -42,28 +42,32 @@ class Scanner extends Component
|
|||||||
{
|
{
|
||||||
$container = Container::instance();
|
$container = Container::instance();
|
||||||
foreach ($this->files as $file) {
|
foreach ($this->files as $file) {
|
||||||
$class = $this->rename($file);
|
try {
|
||||||
if (!class_exists($class)) {
|
$class = $this->rename($file);
|
||||||
continue;
|
if (!class_exists($class)) {
|
||||||
}
|
|
||||||
$reflect = $container->getReflectionClass($class);
|
|
||||||
if ($reflect->isInstantiable()) {
|
|
||||||
$data = $reflect->getAttributes(Skip::class);
|
|
||||||
if (count($data) > 0) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$object = $container->parse($class);
|
$reflect = $container->getReflectionClass($class);
|
||||||
|
if ($reflect->isInstantiable()) {
|
||||||
$methods = $container->getReflectionClass($class);
|
$data = $reflect->getAttributes(Skip::class);
|
||||||
foreach ($methods->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
|
if (count($data) > 0) {
|
||||||
if ($method->isStatic() || $method->getDeclaringClass()->getName() != $class) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$attributes = $method->getAttributes();
|
$object = $container->parse($class);
|
||||||
foreach ($attributes as $attribute) {
|
|
||||||
$attribute->newInstance()->dispatch($object, $method->getName());
|
$methods = $container->getReflectionClass($class);
|
||||||
|
foreach ($methods->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
|
||||||
|
if ($method->isStatic() || $method->getDeclaringClass()->getName() != $class) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$attributes = $method->getAttributes();
|
||||||
|
foreach ($attributes as $attribute) {
|
||||||
|
$attribute->newInstance()->dispatch($object, $method->getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}catch (\Throwable $exception) {
|
||||||
|
error($exception);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user