From 1600309e6a7564d863375d58af847a754241c38a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20L=C3=B8vgaard?= Date: Tue, 9 Apr 2024 08:45:05 +0200 Subject: [PATCH] Update to PHP 8.1 syntax --- rector.php | 17 +++++++++++++++++ src/Checker/StaticConsentChecker.php | 15 ++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 rector.php diff --git a/rector.php b/rector.php new file mode 100644 index 0000000..27b2309 --- /dev/null +++ b/rector.php @@ -0,0 +1,17 @@ +paths([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]); + + $rectorConfig->sets([ + LevelSetList::UP_TO_PHP_81 + ]); +}; diff --git a/src/Checker/StaticConsentChecker.php b/src/Checker/StaticConsentChecker.php index 4f291df..6b1e292 100644 --- a/src/Checker/StaticConsentChecker.php +++ b/src/Checker/StaticConsentChecker.php @@ -8,15 +8,12 @@ final class StaticConsentChecker implements ConsentCheckerInterface { - /** @var array */ - private array $consents; - - /** - * @param array $consents - */ - public function __construct(array $consents) - { - $this->consents = $consents; + public function __construct( + /** + * @var array $consents + */ + private readonly array $consents, + ) { } public function isGranted(string $consent): bool