Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clone this wiki locally
CakePHP 4.0 will be a breaking change from 3.x. Unlike 3.0, 4.0 will primarily be a clean-up release. Instead of introducing large backwards incompatible changes, 4.0.0 will focus on removing all the deprecated features we've accumulated throughout the life of 3.x. Any method/feature emitting run-time warnings in 3.6 will be removed from 4.0. 4.0 will not add significant new features as the bulk of the release will be spent on cleanup efforts.
- Remove all deprecated methods.
Remove non-static methods from
Cake\Database\Typeand move the common instance methods into a trait.
Fix array options for
Add methods to all interfaces currently defined with
@method. See 12094
- Add interface for mail transport classes. See 12084
- Clean up Request\Response objects. Both objects will become immutable as per the PSR7 recommendations.
- Implement batch casting for core database types. See 11754.
- Remove auto-id addition in form URL calls. See 11794
- Remove magic file handling from responses 11921
- Undo revert and re-add proper consistent typehinting.
Require at Least PHP 7.1
By the time CakePHP 4.x ships PHP5 will only be receiving security fixes. The same is true for PHP 7.0.x. Because of this, CakePHP 4.x will require at least PHP 7.1, maybe 7.2.
Use stricter typing where possible
With PHP5 support removed, internally we should aim to leverage scalar type hints and strict typing as much as possible. These features reduce the number of tests and code we need to maintain/run for type checking. The addition of type hints should not be added if they will cause significant backwards compatibility breaks. One of the goals of 4.x is be a 'simple' upgrade from 3.x.
Use new features of PHP 7.1+
- Use Null coalesce
- Use nullable return types and parameter types.
Implement PSR 6 or PSR 16
Splitting up combined setter/getter methods
Splitting the combined wrappers reduces complexity and risk of errors and at the same time provides a simpler API that is also more PHP7+ compatible. We will try to be as BC as possible here during 4.x and remove them in the next major version only.
Typehinting with Interfaces
- Behavior constructor typehint from Table to RepositoryInterface
- Event typehint from Event to EventInterface
Some of these things couldn't be done in 3.x due to BC reasons, but can be applied to 4.x.
falsefor "nullable" return alternative where possible (
- Config merges shallow by default #7267
- Hash::extract() not transforming values anymore #8053
- Remove all the 'prior to' notices.
Remove all the
Update routing examples to use