Skip to content

Commit

Permalink
fix "PHP 8 requires both annotation and attribute to create secured l…
Browse files Browse the repository at this point in the history
…ink"
  • Loading branch information
haltuf committed Dec 8, 2022
1 parent 752ad93 commit 21cfbdb
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 21cfbdb

Please sign in to comment.