Skip to content

Commit

Permalink
Merge pull request #34 from laminas/renovate/lock-file-maintenance
Browse files Browse the repository at this point in the history
Update dependencies, document `FilterIterator` generic types
  • Loading branch information
Ocramius committed Dec 3, 2022
2 parents c61eb1e + e0f131e commit ce76d1a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 31 deletions.
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 11 additions & 18 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@
</MissingReturnType>
</file>
<file src="src/Filter/FilterIterator.php">
<DocblockTypeContradiction occurrences="1">
<code>is_object($value)</code>
</DocblockTypeContradiction>
<LessSpecificImplementedReturnType occurrences="1">
<code>mixed</code>
</LessSpecificImplementedReturnType>
Expand All @@ -84,22 +81,20 @@
<code>$item['data']</code>
<code>$item['priority']</code>
</MixedArrayAccess>
<MixedAssignment occurrences="5">
<code>$item</code>
<code>$item</code>
<code>$item</code>
<code>$items[]</code>
<code>$next</code>
</MixedAssignment>
<MixedFunctionCall occurrences="1">
<code>$next($context, $params, $chain)</code>
</MixedFunctionCall>
<MoreSpecificImplementedParamType occurrences="1">
<code>$value</code>
</MoreSpecificImplementedParamType>
<RedundantConditionGivenDocblockType occurrences="1">
<code>gettype($value)</code>
</RedundantConditionGivenDocblockType>
<PossiblyInvalidArrayAccess occurrences="3">
<code>$item['data']</code>
<code>$item['data']</code>
<code>$item['priority']</code>
</PossiblyInvalidArrayAccess>
<PossiblyInvalidFunctionCall occurrences="1">
<code>$next($context, $params, $chain)</code>
</PossiblyInvalidFunctionCall>
</file>
<file src="src/FilterChain.php">
<ImplementedReturnTypeMismatch occurrences="2">
Expand All @@ -112,15 +107,15 @@
<InvalidReturnType occurrences="1">
<code>CallbackHandler</code>
</InvalidReturnType>
<MixedAssignment occurrences="1">
<code>$next</code>
</MixedAssignment>
<MixedFunctionCall occurrences="1">
<code>$next($context, $argv, $chain)</code>
</MixedFunctionCall>
<ParamNameMismatch occurrences="1">
<code>$argv</code>
</ParamNameMismatch>
<PossiblyInvalidFunctionCall occurrences="1">
<code>$next($context, $argv, $chain)</code>
</PossiblyInvalidFunctionCall>
<UndefinedDocblockClass occurrences="1">
<code>CallbackHandler</code>
</UndefinedDocblockClass>
Expand Down Expand Up @@ -337,8 +332,6 @@
<MissingClosureParamType occurrences="2">
<code>$result</code>
<code>$result</code>
<code>$result</code>
<code>$result</code>
</MissingClosureParamType>
<TypeDoesNotContainType occurrences="2">
<code>assertFalse</code>
Expand Down
10 changes: 6 additions & 4 deletions src/Filter/FilterIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@
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;

/**
* Specialized priority queue implementation for use with an intercepting
* filter chain.
*
* Allows removal
*
* @template TValue of mixed
* @template-extends FastPriorityQueue<TValue>
*/
class FilterIterator extends FastPriorityQueue
{
/**
* Does the queue contain a given value?
*
* @param mixed $datum
* @param TValue $datum
* @return bool
*/
public function contains($datum)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ce76d1a

Please sign in to comment.