diff --git a/phpstan.neon b/phpstan.neon index cc1f8de..ef6cdd2 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7,7 +7,6 @@ parameters: checkFunctionNameCase: true checkInternalClassCaseSensitivity: true treatPhpDocTypesAsCertain: false - checkGenericClassInNonGenericObjectType: false paths: - src diff --git a/src/Filter/Chain.php b/src/Filter/Chain.php index 9422d3a..c0060e6 100644 --- a/src/Filter/Chain.php +++ b/src/Filter/Chain.php @@ -8,6 +8,7 @@ use OutOfBoundsException; use Traversable; +/** @implements IteratorAggregate */ abstract class Chain implements Rule, MetaDataProvider, IteratorAggregate, Countable { use MetaData; diff --git a/src/PriorityQueue.php b/src/PriorityQueue.php index c3576e8..1992ec5 100644 --- a/src/PriorityQueue.php +++ b/src/PriorityQueue.php @@ -7,6 +7,10 @@ /** * Stable priority queue that also maintains insertion order for items with the same priority + * + * @template TPriority + * @template TValue + * @extends SplPriorityQueue */ class PriorityQueue extends SplPriorityQueue { @@ -14,9 +18,14 @@ class PriorityQueue extends SplPriorityQueue protected $serial = PHP_INT_MAX; /** - * @inheritDoc + * Inserts an element in the queue by sifting it up. * * Maintains insertion order for items with the same priority. + * + * @param TValue $value + * @param TPriority $priority + * + * @return bool */ public function insert($value, $priority): bool { @@ -36,7 +45,7 @@ public function yieldAll() $queue->setExtractFlags(static::EXTR_BOTH); foreach ($queue as $item) { - /** @var array{priority: array{0: mixed, 1: int}, data: mixed} $item */ + /** @var array{priority: array{0: TPriority, 1: int}, data: TValue} $item */ yield $item['priority'][0] => $item['data']; } }