Skip to content

Commit

Permalink
Add 2nd level section headings to improve structure of the migration …
Browse files Browse the repository at this point in the history
…guide

Signed-off-by: George Steel <[email protected]>
  • Loading branch information
gsteel committed Sep 13, 2023
1 parent 20f5a14 commit 7290508
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/book/v4/migration/v3-to-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

Version 4 of `laminas-stdlib` contains a number of backwards incompatible changes. This guide is intended to help you upgrade from the version 3 series to version 4.

## New Features

### Parameter, Property and Return Type Hints Have Been Added Throughout

All classes have been updated to make use of parameter and return types. In general usage, this should not pose too many problems, providing you have been passing the previously documented types to the methods that have changed, however, it is advisable to audit your existing usage of the library for potential type errors. A static analysis tool like Psalm or PHPStan will help you with this.

The addition of property, parameter and return types will cause fatal errors for extending classes that re-define those properties or override changed methods. If you have extended from any classes in laminas-stdlib, you should check that property types and method signatures are compatible and update them if they are not aligned.

## Removed Features

None.

## Signature Changes

### Breaking Changes to Return Types in Iterable Classes

A number of Queue, Stack and Heap implementations have different return types in order to align with the built-in PHP interfaces that they implement such as `Iterator` or `IteratorAggregate` etc.
Expand All @@ -27,3 +35,7 @@ PHP's built-in `\SplPriorityQueue`, `\SplHeap`, `\SplMinHeap` and other similar

- `next()` previously returned `false` or the node value at the next index and now returns `void` to align with the `Iterator` interface.
- `setPriority()` previously returned `self` and now returns `void` for consistency.

## Deprecations

None.

0 comments on commit 7290508

Please sign in to comment.