- Fixed missing tags from traits

This commit is contained in:
Dave M. 2023-11-17 21:59:29 -05:00
parent 5f00c2b603
commit 0fcff83eac
2 changed files with 10 additions and 10 deletions

View File

@ -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),

View File

@ -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));
}
}