改名
This commit is contained in:
@@ -153,7 +153,11 @@ class Annotation extends Component
|
|||||||
|
|
||||||
$names = [];
|
$names = [];
|
||||||
foreach ($attributes as $attribute) {
|
foreach ($attributes as $attribute) {
|
||||||
$names[$attribute->getName()] = $this->instance($attribute);
|
$class = $this->instance($attribute);
|
||||||
|
if ($class === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$names[$attribute->getName()] = $class;
|
||||||
}
|
}
|
||||||
|
|
||||||
$tmp['handler'] = [$object, $method->getName()];
|
$tmp['handler'] = [$object, $method->getName()];
|
||||||
@@ -203,7 +207,11 @@ class Annotation extends Component
|
|||||||
$this->_targets[$name] = [];
|
$this->_targets[$name] = [];
|
||||||
}
|
}
|
||||||
foreach ($attributes as $attribute) {
|
foreach ($attributes as $attribute) {
|
||||||
$this->_targets[$name][] = $this->instance($attribute);
|
$class = $this->instance($attribute);
|
||||||
|
if ($class === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$this->_targets[$name][] = $class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
@@ -212,12 +220,13 @@ class Annotation extends Component
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ReflectionAttribute $attribute
|
* @param ReflectionAttribute $attribute
|
||||||
* @return array|object
|
* @return array|object|null
|
||||||
*/
|
*/
|
||||||
private function instance(ReflectionAttribute $attribute): array|object
|
private function instance(ReflectionAttribute $attribute): array|object|null
|
||||||
{
|
{
|
||||||
var_dump($attribute->getName());
|
if (!class_exists($attribute->getName())) {
|
||||||
var_dump($attribute->getTarget());
|
return null;
|
||||||
|
}
|
||||||
return $attribute->newInstance();
|
return $attribute->newInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user