Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Add the suffix "Hydrator" to all hydrators #89

Merged

Conversation

weierophinney
Copy link
Member

We have already used the suffix convention with all filters, strategies, and naming strategies, and even used it with the DelegatingHydrator and AggregateHydrator. As such, not using suffixes is inconsistent internally.

Additionally, it helps prevent ambiguity when importing the classes, particularly with the Reflection hydrator (as Reflection is an existing PHP internal class name).

This patch makes the following renames:

  • ArraySerializable becomes ArraySerializableHydrator
  • ClassMethods becomes ClassMethodsHydrator
  • ObjectProperty becomes ObjectPropertyHydrator
  • Reflection becomes ReflectionHydrator

In each case, the original class has been re-added to the repository as a deprecated extension, to be removed in version 4.0.0; this was done to make migration easier for end-users.

Additionally, aliases under the original class name were added to the HydratorPluginManager, pointing to the equivalent service under the new class name, allowing retrieval by either FQCN or short name, and resolving to the correct class.

Change is made everywhere, including the `HydratorPluginManager`. That
class keeps the old aliases for `ArraySerializable`, but has them point
to the `ArraySerializableHydrator` service; it also adds new aliases for
the new hydrator name.
Change is made everywhere, including the `HydratorPluginManager`. That
class keeps the old aliases for `ClassMethods`, but has them point
to the `ClassMethodsHydrator` service; it also adds new aliases for
the new hydrator name.
Change is made everywhere, including the `HydratorPluginManager`. That
class keeps the old aliases for `ObjectProperty`, but has them point
to the `ObjectPropertyHydrator` service; it also adds new aliases for
the new hydrator name.
Change is made everywhere, including the `HydratorPluginManager`. That
class keeps the old aliases for `Reflection`, but has them point
to the `ReflectionHydrator` service; it also adds new aliases for
the new hydrator name.
This patch re-adds the following classes as deprecated extensions of the
new hydrators:

- `ArraySerializable` (extends `ArraySerializableHydrator`)
- `ClassMethods` (extends `ClassMethodsHydrator`)
- `ObjectProperty` (extends `ObjectPropertyHydrator`)
- `Reflection` (extends `ReflectionHydrator`)

The `HydratorPluginManager` has been updated to alias these class names
to the canonical version.
Also adds a section to the migration document detailing impact.
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Ocramius Ocramius self-assigned this Dec 5, 2018
@Ocramius Ocramius merged commit aeb4c53 into zendframework:develop Dec 5, 2018
@weierophinney weierophinney deleted the feature/hydrator-suffix branch December 5, 2018 13:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants