From 6e1079a81c6e6ba104dfedc54a972957147e6043 Mon Sep 17 00:00:00 2001 From: Ferdinand Kuhl Date: Tue, 10 Jan 2023 11:55:58 +0100 Subject: [PATCH] Allow PHP 8.1 - for that resolve a keyword conflict with the ReadOnly class --- .woodpecker/functional-tests.yml | 5 ++++- Classes/Annotations/{ReadOnly.php => Unlock.php} | 3 ++- Classes/Aspects/ReadOnlyAspect.php | 2 +- Tests/Functional/Fixtures/Controller/ExampleController.php | 2 +- composer.json | 4 ++-- 5 files changed, 10 insertions(+), 6 deletions(-) rename Classes/Annotations/{ReadOnly.php => Unlock.php} (68%) diff --git a/.woodpecker/functional-tests.yml b/.woodpecker/functional-tests.yml index 02969f7..2ef03d6 100644 --- a/.woodpecker/functional-tests.yml +++ b/.woodpecker/functional-tests.yml @@ -5,10 +5,13 @@ workspace: matrix: FLOW_VERSION: - 7.3 + PHP_VERSION: + - 7.4 + - 8.1 pipeline: functional-tests: - image: thecodingmachine/php:7.4-v4-cli + image: thecodingmachine/php:$PHP_VERSION-v4-cli environment: # Enable the PDO_SQLITE extension - "PHP_EXTENSION_PDO_SQLITE=1" diff --git a/Classes/Annotations/ReadOnly.php b/Classes/Annotations/Unlock.php similarity index 68% rename from Classes/Annotations/ReadOnly.php rename to Classes/Annotations/Unlock.php index 24cc7db..2bf8cc6 100644 --- a/Classes/Annotations/ReadOnly.php +++ b/Classes/Annotations/Unlock.php @@ -8,6 +8,7 @@ namespace DigiComp\FlowSessionLock\Annotations; * @Annotation * @Target({"METHOD"}) */ -final class ReadOnly +#[\Attribute(\Attribute::TARGET_METHOD)] +final class Unlock { } diff --git a/Classes/Aspects/ReadOnlyAspect.php b/Classes/Aspects/ReadOnlyAspect.php index 3728566..7d0ff89 100644 --- a/Classes/Aspects/ReadOnlyAspect.php +++ b/Classes/Aspects/ReadOnlyAspect.php @@ -36,7 +36,7 @@ class ReadOnlyAspect protected bool $readOnly = false; /** - * @Flow\Around("methodAnnotatedWith(DigiComp\FlowSessionLock\Annotations\ReadOnly) || filter(DigiComp\FlowSessionLock\Aspects\ReadOnlyFilter)") + * @Flow\Around("methodAnnotatedWith(DigiComp\FlowSessionLock\Annotations\Unlock) || filter(DigiComp\FlowSessionLock\Aspects\ReadOnlyFilter)") * @param JoinPointInterface $joinPoint * @return mixed */ diff --git a/Tests/Functional/Fixtures/Controller/ExampleController.php b/Tests/Functional/Fixtures/Controller/ExampleController.php index a5ecab9..dbf3a13 100644 --- a/Tests/Functional/Fixtures/Controller/ExampleController.php +++ b/Tests/Functional/Fixtures/Controller/ExampleController.php @@ -22,7 +22,7 @@ class ExampleController extends ActionController /** * @Flow\Session(autoStart=true); - * @FlowSessionLock\ReadOnly + * @FlowSessionLock\Unlock * @return string */ public function unprotectedByAnnotationAction() diff --git a/composer.json b/composer.json index f3ff4d7..1af0f92 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "neos-package", "require": { "neos/flow": "^7.3.0", - "php": ">=7.4", + "php": ">=8.1", "symfony/lock": "^5.2.0" }, "require-dev": { @@ -20,7 +20,7 @@ "package-key": "DigiComp.FlowSessionLock" }, "branch-alias": { - "dev-develop": "3.0.x-dev", + "dev-develop": "4.0.x-dev", "dev-version/2.x-dev": "2.1.x-dev" }, "applied-flow-migrations": [