laminas / laminas-stdlib

SPL extensions, array utilities, error handlers, and more
https://docs.laminas.dev/laminas-stdlib/
BSD 3-Clause "New" or "Revised" License
190 stars 40 forks source link

Add parameter and return types to Queue, Stack and List types #106

Closed gsteel closed 1 year ago

gsteel commented 1 year ago
Q A
Documentation yes
BC Break yes
QA yes

Description

Adds return/property/parameter types to a subset of the iterable types in Stdlib.

I've focussed on queues/stacks here to keep the patch small and easier to review. The intention is to work through other areas of the codebase and add type hints where appropriate in other patches, and update the migration guide with each patch.

This also fixes a bug in SplPriorityQueue where a serialisation round trip would cause unexpected insertion order due to the state of $this->serial not being updated during un-serialize.