改名
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
namespace Annotation;
|
||||
|
||||
|
||||
use Exception;
|
||||
use ReflectionAttribute;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
@@ -114,12 +115,11 @@ class Annotation extends Component
|
||||
* @param string $class
|
||||
* @param string $alias
|
||||
* @return array
|
||||
* @throws ReflectionException
|
||||
* @throws NotFindPropertyException
|
||||
* @throws NotFindClassException
|
||||
* @throws Exception
|
||||
*/
|
||||
private function getReflect(string $class, string $alias): array
|
||||
{
|
||||
try {
|
||||
$reflect = $this->reflectClass($class);
|
||||
var_dump($class, $reflect);
|
||||
if (empty($reflect)) {
|
||||
@@ -134,6 +134,10 @@ class Annotation extends Component
|
||||
$object = $reflect->newInstance();
|
||||
$this->resolveMethod($reflect, $class, $alias, $object);
|
||||
return $this->targets($reflect);
|
||||
} catch (\Throwable $throwable) {
|
||||
$this->addError($throwable);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +150,6 @@ class Annotation extends Component
|
||||
*/
|
||||
private function resolveMethod(ReflectionClass $reflect, $class, $alias, $object)
|
||||
{
|
||||
try {
|
||||
foreach ($reflect->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
|
||||
if ($method->class != $class) {
|
||||
continue;
|
||||
@@ -158,9 +161,6 @@ class Annotation extends Component
|
||||
}
|
||||
$this->_classes[$reflect->getName()][$method->getName()] = $tmp;
|
||||
}
|
||||
} catch (\Throwable $throwable) {
|
||||
$this->addError($throwable);
|
||||
}
|
||||
$this->resolveProperty($reflect, $object);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user