All notable changes to this project will be documented in this file, in reverse chronological order by release.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
Release Notes for 4.1.0
Feature release (minor)
- Total issues resolved: 1
- Total pull requests resolved: 1
- Total contributors: 1
- 43: Add NullableStrategy thanks to @eugene-borovov
- 42: HydratorStrategy extract empty value thanks to @eugene-borovov
Release Notes for 4.0.2
-
Total issues resolved: 0
-
Total pull requests resolved: 1
-
Total contributors: 1
-
36: Fix example in quick-start.md thanks to @vjik
Release Notes for 4.0.1
- Total issues resolved: 1
- Total pull requests resolved: 1
- Total contributors: 2
- 39: Provide v4 documentation thanks to @weierophinney and @rieschl
-
#30 modifies all
Laminas\Hydrator\Filter\FilterInterfaceimplementations shipped with the package, marking them asfinal. If you previously extended them, you will need to copy and paste the implementations, or open an issue requesting removal of thefinalkeyword, detailing your use case. -
#30 changes the signature of
Laminas\Hydrator\Filter\FilterInterface::filter()to now accept a second, optional argument,?object $instance = null. This argument's primary use case is with anonymous objects, to facilitate reflection; theClassMethodsHydrator, for instance, was updated to pass the$instancevalue only when an anonymous object is detected. All filter implementations have been updated to the new signature.
- #30 fixes the filter system to allow usage with anonymous objects.
Release Notes for 4.0.0
next backward compatibility break release (major)
- Total issues resolved: 2
- Total pull requests resolved: 2
- Total contributors: 3
- 35: Improve code base per Psalm suggestions thanks to @weierophinney
- 30: Allow anonymous object usage with hydrators thanks to @weierophinney and @luiz-brandao-jr
- 29: PHP 8.0 support thanks to @boesing
- #32 adds support for PHP 8.
- #32 changes the minimum supported version of laminas-stdlib from 3.2 to 3.3.
- #32 removes support for PHP versions prior to 7.3.
Release Notes for 3.2.0
- Total issues resolved: 1
- Total pull requests resolved: 2
- Total contributors: 2
- 33: Adds Psalm integration thanks to @weierophinney and @boesing
- 32: Feature/php 8 support thanks to @weierophinney
Release Notes for 3.1.1
- Total issues resolved: 0
- Total pull requests resolved: 3
- Total contributors: 3
- 27: Update map-naming-strategy.md thanks to @xorock
- 24: Rework the Index and Quick Start guide thanks to @settermjd
-
#17 adds a new strategy,
DateTimeImmutableFormatterStrategy, to provide bidirectional conversion between strings andDateTimeImmutableinstances. -
#16 adds a new strategy implementation,
Laminas\Hydrator\Strategy\Hydrator. It can be used to hydrate nested objects and vice versa.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
-
#17 adds a new strategy,
DateTimeImmutableFormatterStrategy, to provide bidirectional conversion between strings andDateTimeImmutableinstances. -
#16 adds a new strategy implementation,
Laminas\Hydrator\Strategy\Hydrator. It can be used to hydrate nested objects and vice versa.
- Nothing.
- Nothing.
- Nothing.
- #5 fixes an error that occurs in
Laminas\Hydrator\Filter\FilterCompositewhen used under the Swoole extension.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- zendframework/zend-hydrator#103 restores the original behavior of the UnderscoreNamingStrategy with regards to how numeric characters are treated. In version 2, they were never used as word boundaries, while version 3.0 used them as word boundaries in very specific, but hard to predict, scenarios. This release restores the original behavior from version 2.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
-
zendframework/zend-hydrator#97 adds a missing
statickeyword toLaminas\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. -
zendframework/zend-hydrator#96 fixes issue with integer keys in
ArraySerializableHydrator. Keys are now cast to strings as we have strict type declaration in the library.
-
zendframework/zend-hydrator#87 adds
Laminas\Hydrator\HydratorPluginManagerInterfaceto allow type-hinting on plugin manager implementations. The interface simply extends the PSR-11 ContainerInterface. -
zendframework/zend-hydrator#87 adds
Laminas\Hydrator\StandaloneHydratorPluginManageras an implementation of each ofPsr\Container\ContainerInterfaceandLaminas\Hydrator\HydratorPluginManagerInterface, along with a factory for creating it,Laminas\Hydrator\StandaloneHydratorPluginManagerFactory. It can act as a replacement forLaminas\Hydrator\HydratorPluginManager, but only supports the shipped hydrator implementations. See the plugin manager documentation for more details on usage. -
zendframework/zend-hydrator#79 adds a third, optional parameter to the
DateTimeFormatterStrategyconstructor. The parameter is a boolean, and, when enabled, a string that can be parsed by theDateTimeconstructor will still result in aDateTimeinstance during hydration, even if the string does not follow the provided date-time format. -
zendframework/zend-hydrator#14 adds the following
finalclasses:\Laminas\Hydrator\NamingStrategy\UnderscoreNamingStrategy\UnderscoreToCamelCaseFilter\Laminas\Hydrator\NamingStrategy\UnderscoreNamingStrategy\CamelCaseToUnderscoreFilter
-
zendframework/zend-hydrator#89 renames the various hydrators to use the "Hydrator" suffix:
ArraySerializablebecomesArraySerializableHydratorClassMethodsbecomesClassMethodsHydratorObjectPropertybecomesObjectPropertyHydratorReflectionbecomesReflectionHydratorIn each case, the original class was re-added to the repository as a deprecated extension of the new class, to be removed in version 4.0.0.
Aliases resolving the original class name to the new class were also added to the
HydratorPluginManagerto ensure you can still obtain instances. -
zendframework/zend-hydrator#87 modifies
Laminas\Hydrator\ConfigProviderto add a factory entry forLaminas\Hydrator\StandaloneHydratorPluginManager. -
zendframework/zend-hydrator#87 modifies
Laminas\Hydrator\ConfigProviderto change the target of theHydratorManageralias based on the presence of the laminas-servicemanager package; if the package is not available, the target points toLaminas\Hydrator\StandaloneHydratorPluginManagerinstead ofLaminas\Hydrator\HydratorPluginManager. -
zendframework/zend-hydrator#83 renames
Laminas\Hydrator\FilterEnabledInterfacetoLaminas\Hydrator\Filter\FilterEnabledInterface(new namespace). -
zendframework/zend-hydrator#83 renames
Laminas\Hydrator\NamingStrategyEnabledInterfacetoLaminas\Hydrator\NamingStrategy\NamingStrategyEnabledInterface(new namespace). -
zendframework/zend-hydrator#83 renames
Laminas\Hydrator\StrategyEnabledInterfacetoLaminas\Hydrator\Strategy\StrategyEnabledInterface(new namespace). -
zendframework/zend-hydrator#82 and zendframework/zend-hydrator#85 change
Laminas\Hydrator\NamingStrategy\MapNamingStrategyin the following ways:- The class is now marked
final. - The constructor is marked private. You can no longer instantiate it directly.
- The class offers three new named constructors; one of these MUST be used to
create an instance, as the constructor is now final:
MapNamingStrategy::createFromExtractionMap(array $extractionMap) : MapNamingStrategywill use the provided extraction map for extraction operations, and flip it for hydration operations.MapNamingStrategy::createFromHydrationMap(array $hydrationMap) : MapNamingStrategywill use the provided hydration map for hydration operations, and flip it for extraction operations.MapNamingStrategy::createFromAssymetricMap(array $extractionMap, array $hydrationMap) : MapNamingStrategywill use the appropriate map based on the requested operation.
- The class is now marked
-
zendframework/zend-hydrator#80 bumps the minimum supported PHP version to 7.2.
-
zendframework/zend-hydrator#80 bumps the minimum supported laminas-eventmanager version to 3.2.1. laminas-eventmanager is only required if you are using the
AggregateHydrator. -
zendframework/zend-hydrator#80 bumps the minimum supported laminas-serializer version to 2.9.0. laminas-serializer is only required if you are using the
SerializableStrategy. -
zendframework/zend-hydrator#80 bumps the minimum supported laminas-servicemanager version to 3.3.2. laminas-servicemanager is only required if you are using the
HydratorPluginManagerorDelegatingHydrator. This change means that some service names supported by laminas-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. -
zendframework/zend-hydrator#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.
-
zendframework/zend-hydrator#14 replaces usage of laminas-filter with the hardcoded filters referenced in the above section.
-
zendframework/zend-hydrator#14 made the following visibility changes to
\Laminas\Hydrator\NamingStrategy\UnderscoreNamingStrategy:- static property
$underscoreToStudlyCaseFilterwas renamed to$underscoreToCamelCaseFilterand markedprivate - static property
$camelCaseToUnderscoreFilterwas markedprivate - method
getCamelCaseToUnderscoreFilterwas markedprivate - method
getUnderscoreToStudlyCaseFilterwas renamed togetUnderscoreToCamelCaseFilterand markedprivate
- static property
- zendframework/zend-hydrator#89 and
zendframework/zend-hydrator#93 deprecate the
following classes, which will be removed in 4.0.0:
Laminas\Hydrator\ArraySerializable(becomesArraySerializableHydrator)Laminas\Hydrator\ClassMethods(becomesClassMethodsHydrator)Laminas\Hydrator\ObjectProperty(becomesObjectPropertyHydrator)Laminas\Hydrator\Reflection(becomesReflectionHydrator)
-
zendframework/zend-hydrator#83 removes the constructor in
Laminas\Hydrator\AbstractHydrator. All initialization is now either performed via property definitions or lazy-loading. -
zendframework/zend-hydrator#82 removes
Laminas\Hydrator\NamingStrategy\ArrayMapNamingStrategy. The functionality it provided has been merged intoLaminas\Hydrator\NamingStrategy\MapNamingStrategy; useMapNamingStrategy::createFromExtractionMap()to create an instance that has the same functionality asArrayMapNamingStrategypreviously provided.
- Nothing.
- Nothing.
- zendframework/zend-hydrator#69 adds support for special pre/post characters in formats passed to the
DateTimeFormatterStrategy. When used, theDateTimeinstances created during hydration will (generally) omit the time element, allowing for more accurate comparisons.
- Nothing.
- Nothing.
- Nothing.
- zendframework/zend-hydrator#70 updates the
DateTimeFormatterStrategyto work with anyDateTimeInterface, and not justDateTime.
- zendframework/zend-hydrator#75 ensures continuous integration requires PHP 7.2 tests to pass; they already were.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- zendframework/zend-hydrator#67 fixes an issue
in the
ArraySerializable::hydrate()logic whereby nested array data was merged instead of replaced during hydration. The hydrator now correctly replaces such data.
-
zendframework/zend-hydrator#27 adds the interface
Laminas\Hydrator\HydratorProviderInterfacefor use with the laminas-modulemanagerServiceListenerimplementation, and updates theHydratorManagerdefinition for theServiceListenerto typehint on this new interface instead of the one provided in laminas-modulemanager.Users implementing the laminas-modulemanager
Laminas\ModuleManger\Feature\HydratorProviderInterfacewill be unaffected, as the method it defines,getHydratorConfig(), will still be identified and used to inject heHydratorPluginManager. However, we recommend updating yourModuleclasses to use the new interface instead. -
zendframework/zend-hydrator#44 adds
Laminas\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 ));
-
zendframework/zend-hydrator#63 adds support for PHP 7.2.
- zendframework/zend-hydrator#44 updates the
ClassMethodshydrator to add a second, optional, boolean argument to the constructor,$methodExistsCheck, and a related methodsetMethodExistsCheck(). 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 isfalse, which retains the previous behavior of not checking if the method is defined. Set the flag totrueto make the check more strict.
- Nothing.
- zendframework/zend-hydrator#63 removes support for HHVM.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- Nothing.
- zendframework/zend-hydrator#65 fixes the
hydration behavior of the
ArraySerializablehydrator when usingexchangeArray(). 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.
- zendframework/zend-hydrator#42 updates the
ConfigProvider::getDependencies()method to map theHydratorPluginManagerclass to theHydratorPluginManagerFactoryclass, and make theHydratorManagerservice an alias to the fully-qualifiedHydratorPluginManagerclass. - zendframework/zend-hydrator#45 changes the
ClassMethodshydrator to take into account naming strategies when present, making it act consistently with the other hydrators.
- Nothing.
- Nothing.
- zendframework/zend-hydrator#59 fixes how the
HydratorPluginManagerFactoryfactory initializes the plugin manager instance, ensuring it is injecting the relevant configuration from theconfigservice and thus seeding it with configured hydrator services. This means that thehydratorsconfiguration will now be honored in non-laminas-mvc contexts.
- Nothing.
- Nothing.
- Nothing.
- zendframework/zend-hydrator#28 fixes the
Module::init()method to properly receive aModuleManagerinstance, and not expect aModuleEvent.
- zendframework/zend-hydrator#26 exposes the
package as a Laminas component and/or generic configuration provider, by adding the
following:
HydratorPluginManagerFactory, which can be consumed by container-interop / laminas-servicemanager to create and return aHydratorPluginManagerinstance.ConfigProvider, which maps the serviceHydratorManagerto the above factory.Module, which does the same asConfigProvider, but specifically for laminas-mvc applications. It also provices a specification toLaminas\ModuleManager\Listener\ServiceListenerto allow modules to provide hydrator configuration.
- Nothing.
- Nothing.
- Nothing.
- zendframework/zend-hydrator#20 imports the documentation from laminas-stdlib, publishes it to https://docs.laminas.dev/laminas-hydrator/, and automates building and publishing the documentation.
- Nothing.
- Nothing.
- zendframework/zend-hydrator#6 add additional unit test coverage
- zendframework/zend-hydrator#17 and zendframework/zend-hydrator#23 update the code to be forwards compatible with laminas-servicemanager v3, and to depend on laminas-stdlib and laminas-eventmanager v3.
- The following classes were marked
final(per their original implementation in laminas-stdlib):Laminas\Hydrator\NamingStrategy\IdentityNamingStrategyLaminas\Hydrator\NamingStrategy\ArrayMapNamingStrategyLaminas\Hydrator\NamingStrategy\CompositeNamingStrategyLaminas\Hydrator\Strategy\ExplodeStrategyLaminas\Hydrator\Strategy\StrategyChainLaminas\Hydrator\Strategy\DateTimeFormatterStrategyLaminas\Hydrator\Strategy\BooleanStrategy
- Nothing.
- Nothing.
- Nothing.
Initial release. This ports all hydrator classes and functionality from laminas-stdlib to a standalone repository. All final keywords are removed, to allow a deprecation cycle in the laminas-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:
Laminas\Hydrator\NamingStrategy\IdentityNamingStrategyLaminas\Hydrator\NamingStrategy\ArrayMapNamingStrategyLaminas\Hydrator\NamingStrategy\CompositeNamingStrategyLaminas\Hydrator\Strategy\ExplodeStrategyLaminas\Hydrator\Strategy\StrategyChainLaminas\Hydrator\Strategy\DateTimeFormatterStrategyLaminas\Hydrator\Strategy\BooleanStrategy
As such, you should not extend them.
- Nothing.
- Nothing.
- Nothing.
- Nothing.