From 6e1079a81c6e6ba104dfedc54a972957147e6043 Mon Sep 17 00:00:00 2001 From: Ferdinand Kuhl Date: Tue, 10 Jan 2023 11:55:58 +0100 Subject: [PATCH 1/3] 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": [ From 12d048e0ca59760cfeb9eef29754708e0ab49d01 Mon Sep 17 00:00:00 2001 From: Ferdinand Kuhl Date: Tue, 10 Jan 2023 11:59:18 +0100 Subject: [PATCH 2/3] - try to fix CI trouble without error message --- .woodpecker/functional-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker/functional-tests.yml b/.woodpecker/functional-tests.yml index 2ef03d6..eb0a840 100644 --- a/.woodpecker/functional-tests.yml +++ b/.woodpecker/functional-tests.yml @@ -11,7 +11,7 @@ matrix: pipeline: functional-tests: - image: thecodingmachine/php:$PHP_VERSION-v4-cli + image: "thecodingmachine/php:${PHP_VERSION}-v4-cli" environment: # Enable the PDO_SQLITE extension - "PHP_EXTENSION_PDO_SQLITE=1" From 719de0e53f2d49e3ba992915c6f74896ca5a0865 Mon Sep 17 00:00:00 2001 From: Ferdinand Kuhl Date: Tue, 10 Jan 2023 12:00:53 +0100 Subject: [PATCH 3/3] - Allow PHP 7.4 again, as no PHP 8.1 features are necessary to work --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1af0f92..f23ba26 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "neos-package", "require": { "neos/flow": "^7.3.0", - "php": ">=8.1", + "php": "^7.4 | ^8.1", "symfony/lock": "^5.2.0" }, "require-dev": {