Skip to content

Commit

Permalink
Merge pull request #42 from haltuf/master
Browse files Browse the repository at this point in the history
fix "PHP 8 requires both annotation and attribute to create secured link
  • Loading branch information
hrach authored Dec 8, 2022
2 parents 49ffce9 + 21cfbdb commit 057b3d9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/SecuredLinksPresenterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ public function createSecuredLink(Component $component, string $link, string $de
$method = $component->formatSignalMethod($signal);
$signalReflection = $reflection->getMethod($method);

if (!$signalReflection->hasAnnotation('secured')) {
break;
}
if (method_exists($signalReflection, 'getAttributes') && count($signalReflection->getAttributes(Secured::class)) === 0) {
if (!($signalReflection->hasAnnotation('secured') || (method_exists($signalReflection, 'getAttributes') && count($signalReflection->getAttributes(Secured::class)) > 0))) {
break;
}

Expand Down

0 comments on commit 057b3d9

Please sign in to comment.