From 21cfbdb0ccfc8f5b6ac38f966eb112b5c65c4d5c Mon Sep 17 00:00:00 2001 From: Michal Haltuf Date: Thu, 8 Dec 2022 09:09:57 +0100 Subject: [PATCH] fix "PHP 8 requires both annotation and attribute to create secured link" --- src/SecuredLinksPresenterTrait.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/SecuredLinksPresenterTrait.php b/src/SecuredLinksPresenterTrait.php index eaab2a6..815b099 100644 --- a/src/SecuredLinksPresenterTrait.php +++ b/src/SecuredLinksPresenterTrait.php @@ -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; }