NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #3186 most downloaded on Packagist
Serialize objects to arrays, and vice versa
Last release 7 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 13 months
Nearly every release is documented
notes for 15 of 16 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
16 releases · first in 2015
Added Nothing. Changed Nothing. Deprecated Nothing. Removed Nothing. Fixed #103 restores the original behavior of the UnderscoreNamingStrategy with re
Added Nothing. Changed Nothing. Deprecated Nothing. Removed Nothing. Fixed #97 adds a missing static keyword to Zend\Hydrator\NamingStrategy\MapNaming
#97 adds a missing static keyword to Zend\Hydrator\NamingStrategy\MapNamingStrategy::createFromAsymmetricMap,
and simultaneously fixes a mis-spelling of the method name (it incorrectly
used two "s" characters previously, and only one "m" in "asymmetric"). As the
method could not be invoked as documented previously, these changes are
considered bugfixes and not BC breaks.
#96 fixes issue with integer keys in ArraySerializableHydrator. Keys are now
cast to strings as we have strict type declaration in the library.
One column per quarter.
Reflection becomes ReflectionHydrator In each case, the original class was re-added to the repository as a deprecated extension of the new class, to b…
#87 adds Zend\Hydrator\HydratorPluginManagerInterface to allow
type-hinting on plugin manager implementations. The interface simply extends
the PSR-11 ContainerInterface.
#87 adds Zend\Hydrator\StandaloneHydratorPluginManager as an implementation
of each of Psr\Container\ContainerInterface and Zend\Hydrator\HydratorPluginManagerInterface,
along with a factory for creating it, Zend\Hydrator\StandaloneHydratorPluginManagerFactory.
It can act as a replacement for Zend\Hydrator\HydratorPluginManager, but
only supports the shipped hydrator implementations. See the plugin manager documentation
for more details on usage.
#79 adds a third, optional parameter to the DateTimeFormatterStrategy constructor.
The parameter is a boolean, and, when enabled, a string that can be parsed by
the DateTime constructor will still result in a DateTime instance during
hydration, even if the string does not follow the provided date-time format.
#14 adds the following final classes:
\Zend\Hydrator\NamingStrategy\UnderscoreNamingStrategy\UnderscoreToCamelCaseFilter\Zend\Hydrator\NamingStrategy\UnderscoreNamingStrategy\CamelCaseToUnderscoreFilter#89 renames the various hydrators to use the "Hydrator" suffix:
ArraySerializable becomes ArraySerializableHydratorClassMethods becomes ClassMethodsHydratorObjectProperty becomes ObjectPropertyHydratorReflection becomes ReflectionHydratorAliases resolving the original class name to the new class were also added to
the HydratorPluginManager to ensure you can still obtain instances.
#87 modifies Zend\Hydrator\ConfigProvider to add a factory entry for
Zend\Hydrator\StandaloneHydratorPluginManager.
#87 modifies Zend\Hydrator\ConfigProvider to change the target of the
HydratorManager alias based on the presence of the zend-servicemanager
package; if the package is not available, the target points to
Zend\Hydrator\StandaloneHydratorPluginManager instead of
Zend\Hydrator\HydratorPluginManager.
#83 renames Zend\Hydrator\FilterEnabledInterface to Zend\Hydrator\Filter\FilterEnabledInterface (new namespace).
#83 renames Zend\Hydrator\NamingStrategyEnabledInterface to Zend\Hydrator\NamingStrategy\NamingStrategyEnabledInterface (new namespace).
#83 renames Zend\Hydrator\StrategyEnabledInterface to Zend\Hydrator\Strategy\StrategyEnabledInterface (new namespace).
#82 and #85 change Zend\Hydrator\NamingStrategy\MapNamingStrategy
in the following ways:
final.MapNamingStrategy::createFromExtractionMap(array $extractionMap) : MapNamingStrategyMapNamingStrategy::createFromHydrationMap(array $hydrationMap) : MapNamingStrategyMapNamingStrategy::createFromAssymetricMap(array $extractionMap, array $hydrationMap) : MapNamingStrategy#80 bumps the minimum supported PHP version to 7.2.
#80 bumps the minimum supported zend-eventmanager version to 3.2.1. zend-eventmanager
is only required if you are using the AggregateHydrator.
#80 bumps the minimum supported zend-serializer version to 2.9.0. zend-serializer is
only required if you are using the SerializableStrategy.
#80 bumps the minimum supported zend-servicemanager version to 3.3.2.
zend-servicemanager is only required if you are using the
HydratorPluginManager or DelegatingHydrator. This change means that
some service names supported by zend-servicemanager v2 will no longer work.
When in doubt, use the fully qualified class name, or the class name minus the
namespace, with correct casing.
#80 adds scalar typehints both to parameters and return values, and object
typehints to parameters, wherever possible. For consumers, this should pose no
discernable change. For those implementing interfaces or extending classes
from this package, updates will be necessary to ensure your code will run.
See the migration guide for details.
#14 replaces usage of zend-filter with the hardcoded filters referenced in
the above section.
#14 made the following visibility changes to \Zend\Hydrator\NamingStrategy\UnderscoreNamingStrategy:
$underscoreToStudlyCaseFilter was renamed to $underscoreToCamelCaseFilter and marked private$camelCaseToUnderscoreFilter was marked privategetCamelCaseToUnderscoreFilter was marked privategetUnderscoreToStudlyCaseFilter was renamed to getUnderscoreToCamelCaseFilter and marked privateZend\Hydrator\ArraySerializable (becomes ArraySerializableHydrator)Zend\Hydrator\ClassMethods (becomes ClassMethodsHydrator)Zend\Hydrator\ObjectProperty (becomes ObjectPropertyHydrator)Zend\Hydrator\Reflection (becomes ReflectionHydrator)#83 removes the constructor in Zend\Hydrator\AbstractHydrator. All
initialization is now either performed via property definitions or lazy-loading.
#82 removes Zend\Hydrator\NamingStrategy\ArrayMapNamingStrategy. The functionality
it provided has been merged into Zend\Hydrator\NamingStrategy\MapNamingStrategy;
use MapNamingStrategy::createFromExtractionMap() to create an instance that
has the same functionality as ArrayMapNamingStrategy previously provided.
Added Nothing. Changed Nothing. Deprecated Nothing. Removed Nothing. Fixed #106 fixes PHP 7.4 compatibility.
Added Nothing. Changed #69 adds support for special pre/post characters in formats passed to the DateTimeFormatterStrategy . When used, the DateTime i
DateTimeFormatterStrategy. When used, the DateTime instances createdAdded #70 updates the DateTimeFormatterStrategy to work with any DateTimeInterface , and not just DateTime . Changed #75 ensures continuous integratio
Added Nothing. Changed Nothing. Deprecated Nothing. Removed Nothing. Fixed #67 fixes an issue in the ArraySerializable::hydrate() logic whereby nested
ArraySerializable::hydrate() logic whereby nested array data was merged instead of replaced during hydration. The hydrator now correctly replaces such data.Users implementing the zend-modulemanager Zend\ModuleManger\Feature\HydratorProviderInterface will be unaffected, as the method it defines, getHydrato
#27 adds the interface Zend\Hydrator\HydratorProviderInterface for use with the zend-modulemanager ServiceListener implementation, and updates the HydratorManager definition for the ServiceListener to typehint on this new interface instead of the one provided in zend-modulemanager.
Users implementing the zend-modulemanager Zend\ModuleManger\Feature\HydratorProviderInterface will be unaffected, as the method it defines, getHydratorConfig(), will still be identified and used to inject he HydratorPluginManager. However, we recommend updating your Module classes to use the new interface instead.
#44 adds Zend\Hydrator\Strategy\CollectionStrategy. This class allows you to provide a single hydrator to use with an array of objects or data that represent the same type.
From the patch, if the "users" property of an object you will hydrate is expected to be an array of items of a type User, you could do the following:
$hydrator->addStrategy('users', new CollectionStrategy(
new ReflectionHydrator(),
User::class
));#63 adds support for PHP 7.2.
ClassMethods hydrator to add a second, optional, boolean argument to the constructor, $methodExistsCheck, and a related method setMethodExistsCheck(). These allow you to specify a flag indicating whether or not the name of a property must directly map to a defined method, versus one that may be called via __call(). The default value of the flag is false, which retains the previous behavior of not checking if the method is defined. Set the flag to true to make the check more strict.Added Nothing. Changed Nothing. Deprecated Nothing. Removed Nothing. Fixed #65 fixes the hydration behavior of the ArraySerializable hydrator when usi
ArraySerializable hydrator when using exchangeArray(). Previously, the method would clear any existing values from the instance, which is problematic when a partial update is provided as values not in the update would disappear. The class now pulls the original values, and recursively merges the replacement with those values.Added Nothing Changes #42 updates the ConfigProvider::getDependencies() method to map the HydratorPluginManager class to the HydratorPluginManagerFact
ConfigProvider::getDependencies() method to map the HydratorPluginManager class to the HydratorPluginManagerFactory class, and make the HydratorManager service an alias to the fully-qualified HydratorPluginManager class.ClassMethods hydrator to take into account naming strategies when present, making it act consistently with the other hydrators.HydratorPluginManagerFactory factory initializes the plugin manager instance, ensuring it is injecting the relevant configuration from the config service and thus seeding it with configured hydrator services. This means that the hydrators configuration will now be honored in non-zend-mvc contexts.### Added - Nothing. ### Deprecated - Nothing. ### Removed - Nothing. ### Fixed - #28 fixes the Module::init() method to properly receive a ModuleMana
Module::init() method to properly receive a ModuleManager instance, and
not expect a ModuleEvent.HydratorPluginManagerFactory, which can be consumed by container-interop / zend-servicemanager to create and return a HydratorPluginManager instance.
HydratorPluginManagerFactory, which can be consumed by container-interop /
zend-servicemanager to create and return a HydratorPluginManager instance.ConfigProvider, which maps the service HydratorManager to the above
factory.Module, which does the same as ConfigProvider, but specifically for
zend-mvc applications. It also provices a specification to
Zend\ModuleManager\Listener\ServiceListener to allow modules to provide
hydrator configuration.### Added - #20 imports the documentation from zend-stdlib, publishes it to https://zendframework.github.io/zend-hydrator/, and automates building and
The following classes were marked final (per their original implementation in zend-stdlib):
final (per their original implementation
in zend-stdlib):
Zend\Hydrator\NamingStrategy\IdentityNamingStrategyZend\Hydrator\NamingStrategy\ArrayMapNamingStrategyZend\Hydrator\NamingStrategy\CompositeNamingStrategyZend\Hydrator\Strategy\ExplodeStrategyZend\Hydrator\Strategy\StrategyChainZend\Hydrator\Strategy\DateTimeFormatterStrategyZend\Hydrator\Strategy\BooleanStrategyNothing published for this version
All final keywords are removed, to allow a deprecation cycle in the zend-stdlib component.
Initial release. This ports all hydrator classes and functionality from zend-stdlib to a standalone repository. All final keywords are removed, to allow a deprecation cycle in the zend-stdlib component.
Please note: the following classes will be marked as final for a version 2.0.0
release to immediately follow 1.0.0:
Zend\Hydrator\NamingStrategy\IdentityNamingStrategyZend\Hydrator\NamingStrategy\ArrayMapNamingStrategyZend\Hydrator\NamingStrategy\CompositeNamingStrategyZend\Hydrator\Strategy\ExplodeStrategyZend\Hydrator\Strategy\StrategyChainZend\Hydrator\Strategy\DateTimeFormatterStrategyZend\Hydrator\Strategy\BooleanStrategyAs such, you should not extend them.
Your coding agent can read these notes before it upgrades. Set up the MCP server →