- Fixed missing tags from traits
This commit is contained in:
parent
5f00c2b603
commit
0fcff83eac
|
@ -34,12 +34,12 @@ class AnnotationReader
|
|||
return $this->parseDocComment($method);
|
||||
}
|
||||
|
||||
protected function parseDocComment(Reflector $reflect)
|
||||
protected function parseDocComment(\Reflector $reflect)
|
||||
{
|
||||
$tags = [];
|
||||
|
||||
if ( $reflect->getAttributes() ) {
|
||||
foreach($reflect->getAttributes() as $attr) {
|
||||
if ( $attributes = $reflect->getAttributes() ) {
|
||||
foreach($attributes as $attr) {
|
||||
try {
|
||||
$tags[] = [
|
||||
'tag' => substr(strrchr($attr->getName(), "\\"), 1),
|
||||
|
|
|
@ -65,13 +65,13 @@ class ObjectReflection {
|
|||
|
||||
if ( $traits = $this->classReflection->getTraits() ) {
|
||||
foreach($traits as $key => $value) {
|
||||
$traitTags = static::fromClass($key)->gatherClass(true);
|
||||
$traitTags = array_merge_recursive($traitTags ?? [], static::fromClass($key)->gatherClass(true));
|
||||
}
|
||||
}
|
||||
|
||||
if ( $interfaces = $this->classReflection->getInterfaces() ) {
|
||||
foreach($interfaces as $key => $value) {
|
||||
$interfaceTags = static::fromClass($key)->gatherClass(true);
|
||||
$interfaceTags = array_merge_recursive($interfaceTags ?? [], static::fromClass($key)->gatherClass(true));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -81,11 +81,11 @@ class ObjectReflection {
|
|||
}
|
||||
|
||||
return array_merge_recursive($class ?? [], $traitTags ?? [], $interfaceTags ?? [], [
|
||||
'tags' => $this->annotationReader->getClass($this->classReflection)
|
||||
] + ( ! $full ? [] : [
|
||||
'traits' => array_map($itemName, $traits),
|
||||
'interfaces' => array_map($itemName, $interfaces),
|
||||
] ));
|
||||
'tags' => $this->annotationReader->getClass($this->classReflection)
|
||||
] + ( ! $full ? [] : [
|
||||
'traits' => array_map($itemName, $traits),
|
||||
'interfaces' => array_map($itemName, $interfaces),
|
||||
] ));
|
||||
}
|
||||
|
||||
public function gatherProperties(bool $full = true, int $filter =
|
||||
|
|
Loading…
Reference in New Issue