From 68fa98dbc02dd89822b03e4231a14ff7e52e71c6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Dec 2022 01:08:16 +0000 Subject: [PATCH 1/2] Lock file maintenance Signed-off-by: Renovate Bot --- composer.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index ba8c150b..5559cb01 100644 --- a/composer.lock +++ b/composer.lock @@ -954,16 +954,16 @@ }, { "name": "laminas/laminas-stdlib", - "version": "3.15.0", + "version": "3.16.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "63b66bd4b696f024f42616b9d95cdb10e5109c27" + "reference": "0880e3dd88eca01eeda9dfdb5a05c38e56902c2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/63b66bd4b696f024f42616b9d95cdb10e5109c27", - "reference": "63b66bd4b696f024f42616b9d95cdb10e5109c27", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/0880e3dd88eca01eeda9dfdb5a05c38e56902c2c", + "reference": "0880e3dd88eca01eeda9dfdb5a05c38e56902c2c", "shasum": "" }, "require": { @@ -974,10 +974,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "^2.4.0", - "phpbench/phpbench": "^1.2.6", - "phpunit/phpunit": "^9.5.25", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.28" + "phpbench/phpbench": "^1.2.7", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0.0" }, "type": "library", "autoload": { @@ -1009,7 +1009,7 @@ "type": "community_bridge" } ], - "time": "2022-10-10T19:10:24+00:00" + "time": "2022-11-30T23:45:45+00:00" }, { "name": "myclabs/deep-copy", From e0f131ed93c882d49284cc3a063b9d628d42ab82 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 07:26:31 +0100 Subject: [PATCH 2/2] Documenting generic types of `FilterIterator`, baselining newly found issues --- psalm-baseline.xml | 29 +++++++++++------------------ src/Filter/FilterIterator.php | 10 ++++++---- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index f76f2540..e1bf1243 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -69,9 +69,6 @@ - - is_object($value) - mixed @@ -84,22 +81,20 @@ $item['data'] $item['priority'] - - $item - $item - $item - $items[] - $next - $next($context, $params, $chain) $value - - gettype($value) - + + $item['data'] + $item['data'] + $item['priority'] + + + $next($context, $params, $chain) + @@ -112,15 +107,15 @@ CallbackHandler - - $next - $next($context, $argv, $chain) $argv + + $next($context, $argv, $chain) + CallbackHandler @@ -337,8 +332,6 @@ $result $result - $result - $result assertFalse diff --git a/src/Filter/FilterIterator.php b/src/Filter/FilterIterator.php index 9800dc1b..8dbbb532 100644 --- a/src/Filter/FilterIterator.php +++ b/src/Filter/FilterIterator.php @@ -5,9 +5,8 @@ use Laminas\EventManager\Exception; use Laminas\Stdlib\FastPriorityQueue; -use function gettype; +use function get_debug_type; use function is_callable; -use function is_object; use function sprintf; /** @@ -15,13 +14,16 @@ * filter chain. * * Allows removal + * + * @template TValue of mixed + * @template-extends FastPriorityQueue */ class FilterIterator extends FastPriorityQueue { /** * Does the queue contain a given value? * - * @param mixed $datum + * @param TValue $datum * @return bool */ public function contains($datum) @@ -50,7 +52,7 @@ public function insert($value, $priority) throw new Exception\InvalidArgumentException(sprintf( '%s can only aggregate callables; received %s', self::class, - is_object($value) ? $value::class : gettype($value) + get_debug_type($value) )); } parent::insert($value, $priority);