Skip to content

Commit

Permalink
set is repeated
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Feb 2, 2024
1 parent 235daf7 commit 84573c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/ReflectionAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public function __construct(
private ReflectionClass|ReflectionMethod|ReflectionProperty|ReflectionClassConstant|ReflectionFunction|ReflectionParameter $reflector,
private int $flags = 0,
private array $arguments = [],
private int $target
private int $target,
private bool $isRepeated
) {
}

Expand All @@ -52,8 +53,7 @@ public function getNode(): Node\Attribute

public function isRepeated(): bool
{
$attributes = $this->reflector->getAttributes($this->attributeName);
return $attributes[0]->isRepeated();
return $this->isRepeated;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/AttributeResolverTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getAttributes(?string $name = null, int $flags = 0): array
$originalAttributes = parent::getAttributes($name, $flags);
foreach ($originalAttributes as $originalAttribute) {
$attributeName = $originalAttribute->getName();
$attributes[] = new ReflectionAttribute($attributeName, $this, $flags, $originalAttribute->getArguments(), $originalAttribute->getTarget());
$attributes[] = new ReflectionAttribute($attributeName, $this, $flags, $originalAttribute->getArguments(), $originalAttribute->getTarget(), $originalAttribute->isRepeated());
}

return $attributes;
Expand Down

0 comments on commit 84573c9

Please sign in to comment.