From 04a48f22ad85abd8fdb13155c805ec709a7757c9 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 19 Jun 2024 10:00:10 +0200 Subject: [PATCH] Use constructor property promotion In accordance with php8.1 use property promotion\ within the constructor method. Less clutter. --- .../Security/Authorization/StoredObjectVoter.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter.php index 781c2c542..7e2becab4 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter.php @@ -24,12 +24,8 @@ use Symfony\Component\Security\Core\Security; */ class StoredObjectVoter extends Voter { - private $security; - private $storedObjectVoters; - public function __construct(Security $security, iterable $storedObjectVoters) { - $this->security = $security; - $this->storedObjectVoters = $storedObjectVoters; + public function __construct(private readonly Security $security, private readonly iterable $storedObjectVoters) { } protected function supports($attribute, $subject): bool