From 08d40ceb7e798b971bce5ea94d31375e4dfa50e2 Mon Sep 17 00:00:00 2001 From: Tom H Anderson Date: Tue, 9 Jan 2024 16:16:22 -0700 Subject: [PATCH 1/6] Support for PHP 8.3 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c49d625a..c03d8ca4 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ ], "homepage": "http://www.doctrine-project.org/", "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", + "php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", "composer-runtime-api": "^2.0", "composer/semver": "^3.0", "doctrine/annotations": "^1.13.3 || ^2", From dd1fd24ff2035398663ee582869f596c3bdebe46 Mon Sep 17 00:00:00 2001 From: Tom H Anderson Date: Tue, 9 Jan 2024 16:18:48 -0700 Subject: [PATCH 2/6] Added PHP 8.3 to continuous integration --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index e00ff28b..ded7619f 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -13,4 +13,4 @@ jobs: name: "PHPUnit" uses: "doctrine/.github/.github/workflows/continuous-integration.yml@2.1.0" with: - php-versions: '["8.0", "8.1", "8.2"]' + php-versions: '["8.0", "8.1", "8.2", "8.3"]' From 6feddd5cac155219468fdd0b21976e3201f631bc Mon Sep 17 00:00:00 2001 From: Tom H Anderson Date: Tue, 9 Jan 2024 16:27:18 -0700 Subject: [PATCH 3/6] Resolved LessSpecificImplementedReturnType from psalm --- src/Form/Element/ObjectMultiCheckbox.php | 2 +- src/Form/Element/ObjectRadio.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Form/Element/ObjectMultiCheckbox.php b/src/Form/Element/ObjectMultiCheckbox.php index 935db30a..c164bd1c 100644 --- a/src/Form/Element/ObjectMultiCheckbox.php +++ b/src/Form/Element/ObjectMultiCheckbox.php @@ -54,7 +54,7 @@ public function setValue($value) /** * {@inheritDoc} * - * @return array + * @return array|string, array{attributes?: array, disabled?: bool, label: non-empty-string, label_attributes?: array, selected?: bool, value: non-empty-string}|string> */ public function getValueOptions(): array { diff --git a/src/Form/Element/ObjectRadio.php b/src/Form/Element/ObjectRadio.php index d21a8eea..00032233 100644 --- a/src/Form/Element/ObjectRadio.php +++ b/src/Form/Element/ObjectRadio.php @@ -41,7 +41,7 @@ public function setValue($value) /** * {@inheritDoc} * - * @return array + * @return array|string, array{attributes?: array, disabled?: bool, label: non-empty-string, label_attributes?: array, selected?: bool, value: non-empty-string}|string> */ public function getValueOptions(): array { From 51e8689398f1eefdceffbcecfefb95739a03f6ea Mon Sep 17 00:00:00 2001 From: Tom H Anderson Date: Tue, 9 Jan 2024 16:35:15 -0700 Subject: [PATCH 4/6] phpcs checks for order of scalar|null --- src/Form/Element/ObjectMultiCheckbox.php | 2 +- src/Form/Element/ObjectRadio.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Form/Element/ObjectMultiCheckbox.php b/src/Form/Element/ObjectMultiCheckbox.php index c164bd1c..193ce389 100644 --- a/src/Form/Element/ObjectMultiCheckbox.php +++ b/src/Form/Element/ObjectMultiCheckbox.php @@ -54,7 +54,7 @@ public function setValue($value) /** * {@inheritDoc} * - * @return array|string, array{attributes?: array, disabled?: bool, label: non-empty-string, label_attributes?: array, selected?: bool, value: non-empty-string}|string> + * @return array|string, array{attributes?: array, disabled?: bool, label: non-empty-string, label_attributes?: array, selected?: bool, value: non-empty-string}|string> */ public function getValueOptions(): array { diff --git a/src/Form/Element/ObjectRadio.php b/src/Form/Element/ObjectRadio.php index 00032233..1bf6868c 100644 --- a/src/Form/Element/ObjectRadio.php +++ b/src/Form/Element/ObjectRadio.php @@ -41,7 +41,7 @@ public function setValue($value) /** * {@inheritDoc} * - * @return array|string, array{attributes?: array, disabled?: bool, label: non-empty-string, label_attributes?: array, selected?: bool, value: non-empty-string}|string> + * @return array|string, array{attributes?: array, disabled?: bool, label: non-empty-string, label_attributes?: array, selected?: bool, value: non-empty-string}|string> */ public function getValueOptions(): array { From d8dd89f587fa9aa4d3443a15c5fdb0d525d9a2a4 Mon Sep 17 00:00:00 2001 From: Tom H Anderson Date: Sun, 14 Jan 2024 12:11:27 -0700 Subject: [PATCH 5/6] Changed version on workflows to 8.2 --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/composer-lint.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 7e5d0a77..d2f0a641 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -13,4 +13,4 @@ jobs: name: "Coding Standards" uses: "doctrine/.github/.github/workflows/coding-standards.yml@2.1.0" with: - php-version: '8.1' + php-version: '8.2' diff --git a/.github/workflows/composer-lint.yml b/.github/workflows/composer-lint.yml index 3aa3dd8e..a1dcff96 100644 --- a/.github/workflows/composer-lint.yml +++ b/.github/workflows/composer-lint.yml @@ -17,4 +17,4 @@ jobs: name: "Composer Lint" uses: "doctrine/.github/.github/workflows/composer-lint.yml@2.1.0" with: - php-version: "8.1" + php-version: "8.2" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 24a9871a..a7b94982 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -13,4 +13,4 @@ jobs: name: "Static Analysis" uses: "doctrine/.github/.github/workflows/static-analysis.yml@2.1.0" with: - php-version: '8.1' + php-version: '8.2' From cb29c8b947b3468b52e359487aae41fb86be78a2 Mon Sep 17 00:00:00 2001 From: Tom H Anderson Date: Sun, 14 Jan 2024 12:34:30 -0700 Subject: [PATCH 6/6] Use imported types for return type of getValueOptions --- src/Form/Element/ObjectMultiCheckbox.php | 3 ++- src/Form/Element/ObjectRadio.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Form/Element/ObjectMultiCheckbox.php b/src/Form/Element/ObjectMultiCheckbox.php index 193ce389..48068f17 100644 --- a/src/Form/Element/ObjectMultiCheckbox.php +++ b/src/Form/Element/ObjectMultiCheckbox.php @@ -11,6 +11,7 @@ use function array_map; use function is_array; +/** @psalm-import-type ValueOptionSpec from MultiCheckbox */ class ObjectMultiCheckbox extends MultiCheckbox { use GetProxy; @@ -54,7 +55,7 @@ public function setValue($value) /** * {@inheritDoc} * - * @return array|string, array{attributes?: array, disabled?: bool, label: non-empty-string, label_attributes?: array, selected?: bool, value: non-empty-string}|string> + * @return ValueOptionSpec */ public function getValueOptions(): array { diff --git a/src/Form/Element/ObjectRadio.php b/src/Form/Element/ObjectRadio.php index 1bf6868c..451ae483 100644 --- a/src/Form/Element/ObjectRadio.php +++ b/src/Form/Element/ObjectRadio.php @@ -4,8 +4,10 @@ namespace DoctrineModule\Form\Element; +use Laminas\Form\Element\MultiCheckbox; use Laminas\Form\Element\Radio as RadioElement; +/** @psalm-import-type ValueOptionSpec from MultiCheckbox */ class ObjectRadio extends RadioElement { use GetProxy; @@ -41,7 +43,7 @@ public function setValue($value) /** * {@inheritDoc} * - * @return array|string, array{attributes?: array, disabled?: bool, label: non-empty-string, label_attributes?: array, selected?: bool, value: non-empty-string}|string> + * @return ValueOptionSpec */ public function getValueOptions(): array {