-
-
Notifications
You must be signed in to change notification settings - Fork 35
docs: add migration guide for v4 to v5 #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1584927
docs: add migration guide for v4 to v5
mmalac 9202f2a
docs: remove icons in v4 to v5 migration guide
mmalac facd014
docs: update v4 to v5 migration guide for consistency and clarity
mmalac ce72406
docs: update v4 to v5 migration guide with removal of Module Manager …
mmalac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Migration from Version 4 to 5 | ||
|
|
||
| ## Changed Behavior & Signature Changes | ||
|
|
||
| ### Final Classes and Inheritance | ||
|
|
||
| As a best practice, even if a hydrator (or other classes) is not marked as `final` in this library, extending it is discouraged — future major releases may prohibit inheritance altogether. | ||
| Prefer **composition over inheritance** by combining small, focused objects. | ||
| Use **decorators** to extend behavior without modifying original classes or creating deep inheritance chains. | ||
|
|
||
| ### Hydrator Plugin Manager | ||
|
|
||
| #### Removal of legacy Zend aliases | ||
|
|
||
| All aliases that referenced the equivalent, legacy "Zend" hydrators have been removed. This means that an exception will be thrown if you attempt to retrieve a hydrator using one of these aliases such as `Zend\Hydrator\ArraySerializableHydrator::class`. | ||
|
|
||
| You will need to either update your codebase to use known aliases such as `Laminas\Hydrator\ArraySerializableHydrator::class`, or re-implement the aliases in your configuration. | ||
|
|
||
| ### Removed Exceptions | ||
|
|
||
| The following exceptions have been removed: | ||
|
|
||
| - `Laminas\Hydrator\Exception\ExtensionNotLoadedException` | ||
| - `Laminas\Hydrator\Exception\InvalidCallbackException` | ||
| - `Laminas\Hydrator\Exception\LogicException` | ||
|
|
||
| ### Changes of `Laminas\Hydrator\Strategy\SerializableStrategy` | ||
|
|
||
| - Simplified implementation. | ||
| - Internal getter and setter methods have been removed. | ||
| - If you're relying on these, update your code to use serialization logic externally or via injected services. | ||
|
|
||
| ### Changes to Individual Hydrators | ||
mairo744 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| The following deprecated classes (since version 3.0.0) have been removed in version 5. | ||
| Please update your codebase to use the corresponding `*Hydrator` classes: | ||
|
|
||
| | Removed Class | Replacement Class | | ||
mairo744 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| |-------------------------------------------|----------------------------------------------------| | ||
| | `Laminas\Hydrator\ArraySerializable` | `Laminas\Hydrator\ArraySerializableHydrator` | | ||
| | `Laminas\Hydrator\ClassMethods` | `Laminas\Hydrator\ClassMethodsHydrator` | | ||
| | `Laminas\Hydrator\ObjectProperty` | `Laminas\Hydrator\ObjectPropertyHydrator` | | ||
| | `Laminas\Hydrator\Reflection` | `Laminas\Hydrator\ReflectionHydrator` | | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.