From 74651758a0ceb3360aad48dcc6fa53482e8cb255 Mon Sep 17 00:00:00 2001 From: George Steel Date: Sat, 29 Jun 2024 15:30:12 +0100 Subject: [PATCH 1/2] Deprecations for `AllowList` and `Boolean` filters Signed-off-by: George Steel --- composer.lock | 128 ++++++++++++++++++++++----------------------- psalm-baseline.xml | 32 +++++++++++- src/AllowList.php | 8 +++ src/Boolean.php | 16 +++++- 4 files changed, 117 insertions(+), 67 deletions(-) diff --git a/composer.lock b/composer.lock index 8a11a96d..d7a6e8a5 100644 --- a/composer.lock +++ b/composer.lock @@ -1324,16 +1324,16 @@ }, { "name": "laminas/laminas-validator", - "version": "2.57.0", + "version": "2.60.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-validator.git", - "reference": "512e133034e51760590e7b0c7db5077e19f25ef1" + "reference": "66ab091fc08a8b1e2851eec62dda4bafa977fe9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/512e133034e51760590e7b0c7db5077e19f25ef1", - "reference": "512e133034e51760590e7b0c7db5077e19f25ef1", + "url": "https://api.github.com/repos/laminas/laminas-validator/zipball/66ab091fc08a8b1e2851eec62dda4bafa977fe9c", + "reference": "66ab091fc08a8b1e2851eec62dda4bafa977fe9c", "shasum": "" }, "require": { @@ -1404,7 +1404,7 @@ "type": "community_bridge" } ], - "time": "2024-06-14T15:24:20+00:00" + "time": "2024-06-25T20:11:22+00:00" }, { "name": "myclabs/deep-copy", @@ -2131,16 +2131,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "10.1.14", + "version": "10.1.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b" + "reference": "5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", - "reference": "e3f51450ebffe8e0efdf7346ae966a656f7d5e5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae", + "reference": "5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae", "shasum": "" }, "require": { @@ -2197,7 +2197,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.14" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.15" }, "funding": [ { @@ -2205,7 +2205,7 @@ "type": "github" } ], - "time": "2024-03-12T15:33:41+00:00" + "time": "2024-06-29T08:25:15+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2452,16 +2452,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.21", + "version": "10.5.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ac837816fa52078f7a5e17ed774f256a72a51af6" + "reference": "5f124e3e3e561006047b532fd0431bf5bb6b9015" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ac837816fa52078f7a5e17ed774f256a72a51af6", - "reference": "ac837816fa52078f7a5e17ed774f256a72a51af6", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5f124e3e3e561006047b532fd0431bf5bb6b9015", + "reference": "5f124e3e3e561006047b532fd0431bf5bb6b9015", "shasum": "" }, "require": { @@ -2533,7 +2533,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.24" }, "funding": [ { @@ -2549,7 +2549,7 @@ "type": "tidelift" } ], - "time": "2024-06-15T09:13:15+00:00" + "time": "2024-06-20T13:09:54+00:00" }, { "name": "psalm/plugin-phpunit", @@ -3896,16 +3896,16 @@ }, { "name": "symfony/console", - "version": "v6.4.8", + "version": "v6.4.9", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "be5854cee0e8c7b110f00d695d11debdfa1a2a91" + "reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/be5854cee0e8c7b110f00d695d11debdfa1a2a91", - "reference": "be5854cee0e8c7b110f00d695d11debdfa1a2a91", + "url": "https://api.github.com/repos/symfony/console/zipball/6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9", + "reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9", "shasum": "" }, "require": { @@ -3970,7 +3970,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.8" + "source": "https://github.com/symfony/console/tree/v6.4.9" }, "funding": [ { @@ -3986,7 +3986,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-06-28T09:49:33+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4057,16 +4057,16 @@ }, { "name": "symfony/filesystem", - "version": "v6.4.8", + "version": "v6.4.9", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "4d37529150e7081c51b3c5d5718c55a04a9503f3" + "reference": "b51ef8059159330b74a4d52f68e671033c0fe463" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/4d37529150e7081c51b3c5d5718c55a04a9503f3", - "reference": "4d37529150e7081c51b3c5d5718c55a04a9503f3", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b51ef8059159330b74a4d52f68e671033c0fe463", + "reference": "b51ef8059159330b74a4d52f68e671033c0fe463", "shasum": "" }, "require": { @@ -4103,7 +4103,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.8" + "source": "https://github.com/symfony/filesystem/tree/v6.4.9" }, "funding": [ { @@ -4119,20 +4119,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-06-28T09:49:33+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -4182,7 +4182,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -4198,20 +4198,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { @@ -4260,7 +4260,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, "funding": [ { @@ -4276,20 +4276,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { @@ -4341,7 +4341,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, "funding": [ { @@ -4357,20 +4357,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -4421,7 +4421,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -4437,7 +4437,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/service-contracts", @@ -4524,16 +4524,16 @@ }, { "name": "symfony/string", - "version": "v6.4.8", + "version": "v6.4.9", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "a147c0f826c4a1f3afb763ab8e009e37c877a44d" + "reference": "76792dbd99690a5ebef8050d9206c60c59e681d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a147c0f826c4a1f3afb763ab8e009e37c877a44d", - "reference": "a147c0f826c4a1f3afb763ab8e009e37c877a44d", + "url": "https://api.github.com/repos/symfony/string/zipball/76792dbd99690a5ebef8050d9206c60c59e681d7", + "reference": "76792dbd99690a5ebef8050d9206c60c59e681d7", "shasum": "" }, "require": { @@ -4590,7 +4590,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.8" + "source": "https://github.com/symfony/string/tree/v6.4.9" }, "funding": [ { @@ -4606,7 +4606,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-06-28T09:25:38+00:00" }, { "name": "theseer/tokenizer", @@ -4660,16 +4660,16 @@ }, { "name": "vimeo/psalm", - "version": "5.24.0", + "version": "5.25.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "462c80e31c34e58cc4f750c656be3927e80e550e" + "reference": "01a8eb06b9e9cc6cfb6a320bf9fb14331919d505" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/462c80e31c34e58cc4f750c656be3927e80e550e", - "reference": "462c80e31c34e58cc4f750c656be3927e80e550e", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/01a8eb06b9e9cc6cfb6a320bf9fb14331919d505", + "reference": "01a8eb06b9e9cc6cfb6a320bf9fb14331919d505", "shasum": "" }, "require": { @@ -4766,7 +4766,7 @@ "issues": "https://github.com/vimeo/psalm/issues", "source": "https://github.com/vimeo/psalm" }, - "time": "2024-05-01T19:32:08+00:00" + "time": "2024-06-16T15:08:35+00:00" }, { "name": "webimpress/coding-standard", diff --git a/psalm-baseline.xml b/psalm-baseline.xml index da1492f7..e6b2bf54 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + @@ -48,6 +48,10 @@ + + + + @@ -65,6 +69,13 @@ + + + + + + + @@ -1442,6 +1453,14 @@ + + + + + + + + @@ -1472,6 +1491,15 @@ + + + + + + + + + @@ -1839,7 +1867,9 @@ + + diff --git a/src/AllowList.php b/src/AllowList.php index ca348a4a..8e7192e4 100644 --- a/src/AllowList.php +++ b/src/AllowList.php @@ -40,6 +40,8 @@ public function __construct($options = null) /** * Determine whether the in_array() call should be "strict" or not. See in_array docs. * + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @param bool $strict */ public function setStrict($strict = true): void @@ -50,6 +52,8 @@ public function setStrict($strict = true): void /** * Returns whether the in_array() call should be "strict" or not. See in_array docs. * + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @return bool */ public function getStrict() @@ -60,6 +64,8 @@ public function getStrict() /** * Set the list of items to white-list. * + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @param array|Traversable $list */ public function setList($list = []): void @@ -74,6 +80,8 @@ public function setList($list = []): void /** * Get the list of items to white-list * + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @return array */ public function getList() diff --git a/src/Boolean.php b/src/Boolean.php index ba892140..602fb8b8 100644 --- a/src/Boolean.php +++ b/src/Boolean.php @@ -104,9 +104,11 @@ public function __construct($typeOrOptions = null, $casting = true, $translation /** * Set boolean types * + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @param self::TYPE_*|int-mask-of|value-of|list|null $type - * @throws Exception\InvalidArgumentException * @return self + * @throws Exception\InvalidArgumentException */ public function setType($type = null) { @@ -140,6 +142,8 @@ public function setType($type = null) /** * Returns defined boolean types * + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @return int-mask-of */ public function getType() @@ -150,6 +154,8 @@ public function getType() /** * Set the working mode * + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @param bool $flag When true this filter works like cast * When false it recognises only true and false * and all other values are returned as is @@ -164,6 +170,8 @@ public function setCasting($flag = true) /** * Returns the casting option * + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @return bool */ public function getCasting() @@ -172,9 +180,11 @@ public function getCasting() } /** + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @param array|Traversable $translations - * @throws Exception\InvalidArgumentException * @return self + * @throws Exception\InvalidArgumentException */ public function setTranslations($translations) { @@ -194,6 +204,8 @@ public function setTranslations($translations) } /** + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @return array */ public function getTranslations() From a1f539cd00997e107d314b002ba7d5a725ebc740 Mon Sep 17 00:00:00 2001 From: George Steel Date: Sat, 29 Jun 2024 18:14:11 +0100 Subject: [PATCH 2/2] Deprecate getters and setters in `Callback` filter Signed-off-by: George Steel --- psalm-baseline.xml | 9 +++++++++ src/Callback.php | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index e6b2bf54..9a529990 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -118,6 +118,10 @@ + + + + options['callback'], $params)]]> @@ -1528,6 +1532,11 @@ + + + + + diff --git a/src/Callback.php b/src/Callback.php index 22e23e23..d74935c3 100644 --- a/src/Callback.php +++ b/src/Callback.php @@ -46,9 +46,11 @@ public function __construct($callbackOrOptions = [], $callbackParams = []) /** * Sets a new callback for this filter * + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @param callable $callback - * @throws Exception\InvalidArgumentException * @return self + * @throws Exception\InvalidArgumentException */ public function setCallback($callback) { @@ -69,6 +71,8 @@ public function setCallback($callback) /** * Returns the set callback * + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @return callable */ public function getCallback() @@ -79,6 +83,8 @@ public function getCallback() /** * Sets parameters for the callback * + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @param array $params * @return self */ @@ -91,6 +97,8 @@ public function setCallbackParams($params) /** * Get parameters for the callback * + * @deprecated since 2.37.0 - All option setters and getters will be removed in 3.0 + * * @return array */ public function getCallbackParams()