Use constructor property promotion

In accordance with php8.1 use property promotion\
within the constructor method. Less clutter.
This commit is contained in:
Julie Lenaerts 2024-06-19 10:00:10 +02:00
parent ad4fe80240
commit 04a48f22ad

View File

@ -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