Skip to content

Commit

Permalink
Titles should be in Title Case
Browse files Browse the repository at this point in the history
Co-authored-by: Frank Brückner <info@froschdesignstudio.de>
Signed-off-by: George Steel <george@netglue.uk>
  • Loading branch information
gsteel and froschdesign authored Sep 13, 2023
1 parent c748740 commit 20f5a14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/book/v4/migration/v3-to-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

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.

### Parameter, property and return type hints have been added throughout
### 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.

### Breaking changes to return types in iterable classes
### 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.

#### `insert()` signature change for iterable types
#### `insert()` Signature Change for Iterable Types

PHP's built-in `\SplPriorityQueue`, `\SplHeap`, `\SplMinHeap` and other similar classes return `true` from the `insert()` method. Classes that either extend from or have similar semantics to these built-in types previously had varying return types such as `void`, `self`. From version 4, the method signature for `insert()` where implemented has been changed to `bool` _(true)_.

Expand All @@ -21,7 +21,7 @@ PHP's built-in `\SplPriorityQueue`, `\SplHeap`, `\SplMinHeap` and other similar
- `Laminas\Stdlib\PriorityList::insert()` previously returned `void`. This has been changed to `bool` for consistency
- `Laminas\Stdlib\FastPriorityQueue::insert()` previously returned `void`. This has been changed to `bool` for consistency

#### Other method signature changes
#### Other Method Signature Changes

##### `Laminas\Stdlib\PriorityList`

Expand Down

0 comments on commit 20f5a14

Please sign in to comment.