diff --git a/src/ObjectResolver.php b/src/ObjectResolver.php index e7b5f6a..82016e7 100644 --- a/src/ObjectResolver.php +++ b/src/ObjectResolver.php @@ -73,23 +73,27 @@ class ObjectResolver { if ( $name = $this->uses[$className] ?? false) { foreach($this->class['tags'] as $item) { - if ( $item['tag'] === $name ) { + if ($item['tag'] === $name) { $list[] = $this->instanciateAnnotationObject($item); } + } - foreach($this->properties as $property) { - foreach($property['tags'] as $item) { - if ( $item['tag'] === $name ) { - $list[$property['name']] = $this->instanciateAnnotationObject($item); - } + foreach($this->properties as $property) { + foreach($property['tags'] as $item) { + if ( $item['tag'] === $name ) { + $list[$property['name']] ??= []; + + $list[$property['name']][] = $this->instanciateAnnotationObject($item); } } + } - foreach($this->methods as $method) { - foreach($method['tags'] as $item) { - if ( $item['tag'] === $name ) { - $list[$method['name']] = $this->instanciateAnnotationObject($item); - } + foreach($this->methods as $method) { + foreach($method['tags'] as $item) { + if ( $item['tag'] === $name ) { + $list[$method['name']] ??= []; + + $list[$method['name']][] = $this->instanciateAnnotationObject($item); } } }