From 6ed0bb1bf79c0299102ab8fedc6ace220b871159 Mon Sep 17 00:00:00 2001 From: George Steel Date: Fri, 19 Jan 2024 09:47:14 +0000 Subject: [PATCH 1/6] Bump dev deps, refresh lock Signed-off-by: George Steel --- composer.json | 6 +++--- composer.lock | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 974e19d9..bb713ea8 100644 --- a/composer.json +++ b/composer.json @@ -31,10 +31,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "^2.5", - "phpbench/phpbench": "^1.2.14", - "phpunit/phpunit": "^10.3.3", + "phpbench/phpbench": "^1.2.15", + "phpunit/phpunit": "^10.5.8", "psalm/plugin-phpunit": "^0.18.4", - "vimeo/psalm": "^5.15.0" + "vimeo/psalm": "^5.20.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 49b42b48..96bf6c4b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8e628fbb1d53887883bae250fe3b4691", + "content-hash": "0d90a81d219cadabe4084af5eddc5483", "packages": [], "packages-dev": [ { @@ -1956,16 +1956,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.7", + "version": "10.5.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e5c5b397a95cb0db013270a985726fcae93e61b8" + "reference": "08f4fa74d5fbfff1ef22abffee47aaedcaea227e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e5c5b397a95cb0db013270a985726fcae93e61b8", - "reference": "e5c5b397a95cb0db013270a985726fcae93e61b8", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/08f4fa74d5fbfff1ef22abffee47aaedcaea227e", + "reference": "08f4fa74d5fbfff1ef22abffee47aaedcaea227e", "shasum": "" }, "require": { @@ -2037,7 +2037,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.7" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.8" }, "funding": [ { @@ -2053,7 +2053,7 @@ "type": "tidelift" } ], - "time": "2024-01-14T16:40:30+00:00" + "time": "2024-01-19T07:07:27+00:00" }, { "name": "psalm/plugin-phpunit", @@ -4416,16 +4416,16 @@ }, { "name": "vimeo/psalm", - "version": "5.19.0", + "version": "5.20.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "06b71be009a6bd6d81b9811855d6629b9fe90e1b" + "reference": "3f284e96c9d9be6fe6b15c79416e1d1903dcfef4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/06b71be009a6bd6d81b9811855d6629b9fe90e1b", - "reference": "06b71be009a6bd6d81b9811855d6629b9fe90e1b", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/3f284e96c9d9be6fe6b15c79416e1d1903dcfef4", + "reference": "3f284e96c9d9be6fe6b15c79416e1d1903dcfef4", "shasum": "" }, "require": { @@ -4522,7 +4522,7 @@ "issues": "https://github.com/vimeo/psalm/issues", "source": "https://github.com/vimeo/psalm" }, - "time": "2024-01-09T21:02:43+00:00" + "time": "2024-01-18T12:15:06+00:00" }, { "name": "webimpress/coding-standard", From b29cdcff8ee503c5b420c50b2adad76c726815af Mon Sep 17 00:00:00 2001 From: George Steel Date: Fri, 19 Jan 2024 09:47:52 +0000 Subject: [PATCH 2/6] Fix `RiskyTruthyFalsyComparison` issue introduced in Psalm 5.20.x Signed-off-by: George Steel --- src/ArrayUtils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArrayUtils.php b/src/ArrayUtils.php index 935d9889..b6eb6412 100644 --- a/src/ArrayUtils.php +++ b/src/ArrayUtils.php @@ -198,7 +198,7 @@ public static function isHashTable(mixed $value, $allowEmpty = false) */ public static function inArray(mixed $needle, array $haystack, $strict = false) { - if (! $strict) { + if ($strict === false) { if (is_int($needle) || is_float($needle)) { $needle = (string) $needle; } From d80a3657e8c541b376455f0d43278a8e0046aac5 Mon Sep 17 00:00:00 2001 From: George Steel Date: Fri, 19 Jan 2024 09:56:56 +0000 Subject: [PATCH 3/6] On PHP 8.4 `SplPriorityQueue::insert` should have a return type of bool Signed-off-by: George Steel --- src/SplPriorityQueue.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SplPriorityQueue.php b/src/SplPriorityQueue.php index 8244f140..0c5a80dc 100644 --- a/src/SplPriorityQueue.php +++ b/src/SplPriorityQueue.php @@ -4,6 +4,7 @@ namespace Laminas\Stdlib; +use ReturnTypeWillChange; use Serializable; use UnexpectedValueException; @@ -41,6 +42,7 @@ class SplPriorityQueue extends \SplPriorityQueue implements Serializable * @param TPriority $priority * @return void */ + #[ReturnTypeWillChange] // Inherited return type should be bool public function insert($value, $priority) { if (! is_array($priority)) { From 4b2e8aae0afa79b89af4992cd7d40b55dfbb279b Mon Sep 17 00:00:00 2001 From: George Steel Date: Fri, 19 Jan 2024 10:03:25 +0000 Subject: [PATCH 4/6] Add `failOn(deprecation|notice|warning)` to PHPUnit configuration Signed-off-by: George Steel --- phpunit.xml.dist | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 58595928..2669dba3 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -11,6 +11,9 @@ displayDetailsOnTestsThatTriggerWarnings="true" displayDetailsOnIncompleteTests="true" displayDetailsOnSkippedTests="true" + failOnDeprecation="true" + failOnNotice="true" + failOnWarning="true" > From 1d0ed8a6a757c84f70966557460f8422b7158c73 Mon Sep 17 00:00:00 2001 From: George Steel Date: Fri, 19 Jan 2024 10:09:21 +0000 Subject: [PATCH 5/6] Reset psalm baseline Signed-off-by: George Steel --- psalm-baseline.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index ae214b1a..99b2cdfa 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + @@ -216,11 +216,7 @@ $priority $priority - - public function insert($value, $priority) - - insert serialize unserialize From 2b88fe55ad8f6291fafa2e90a2ccdeda0a0b5e77 Mon Sep 17 00:00:00 2001 From: George Steel Date: Fri, 19 Jan 2024 10:52:11 +0000 Subject: [PATCH 6/6] cast $strict to bool before comparing. Also deprecate method Signed-off-by: George Steel --- src/ArrayUtils.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ArrayUtils.php b/src/ArrayUtils.php index b6eb6412..7bfa20dc 100644 --- a/src/ArrayUtils.php +++ b/src/ArrayUtils.php @@ -192,13 +192,15 @@ public static function isHashTable(mixed $value, $allowEmpty = false) * non-strict check is implemented. if $strict = -1, the default in_array * non-strict behaviour is used. * + * @deprecated This method will be removed in version 4.0 of this component + * * @param array $haystack * @param int|bool $strict * @return bool */ public static function inArray(mixed $needle, array $haystack, $strict = false) { - if ($strict === false) { + if ((bool) $strict === false) { if (is_int($needle) || is_float($needle)) { $needle = (string) $needle; }