Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Feb 2, 2024
1 parent 209fe1e commit e74cc49
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ReflectionAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

namespace Go\ParserReflection;

use Go\ParserReflection\Traits\InternalPropertiesEmulationTrait;
use ReflectionAttribute as BaseReflectionAttribute;
use PhpParser\Node;
use PhpParser\Node\Param;
Expand All @@ -30,7 +29,7 @@ class ReflectionAttribute extends BaseReflectionAttribute
{
public function __construct(
private string $attributeName,
private \Reflector $reflector,
private Reflector $reflector,
private int $flags = 0
) {
}
Expand All @@ -44,10 +43,12 @@ public function getNode(): Node\Attribute
! $this->reflector instanceof ReflectionClassConstant &&
! $this->reflector instanceof ReflectionFunction &&
! $this->reflector instanceof ReflectionParameter) {
throw new ReflectionException(sprintf('attribute node not available at', $this->reflector::class));
throw new ReflectionException(sprintf('attribute node not available at ', $this->reflector::class));
}

foreach ($this->reflector->getNode()->attrGroups as $attrGroup) {
/** @var Class_|ClassMethod|Property|ClassConst|Function_|Param $node */
$node = $this->reflector->getNode();
foreach ($node->attrGroups as $attrGroup) {
foreach ($attrGroup->attrs as $attr) {
if ($attr->name->toString() === $this->attributeName) {
return $attr;
Expand Down

0 comments on commit e74cc49

Please sign in to comment.