zend-hydrator 3.0.0
Added
-
#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 ofPsr\Container\ContainerInterface
andZend\Hydrator\HydratorPluginManagerInterface
,
along with a factory for creating it,Zend\Hydrator\StandaloneHydratorPluginManagerFactory
.
It can act as a replacement forZend\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
theDateTime
constructor will still result in aDateTime
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
Changed
-
#89 renames the various hydrators to use the "Hydrator" suffix:
ArraySerializable
becomesArraySerializableHydrator
ClassMethods
becomesClassMethodsHydrator
ObjectProperty
becomesObjectPropertyHydrator
Reflection
becomesReflectionHydrator
In 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
theHydratorPluginManager
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
toZend\Hydrator\Filter\FilterEnabledInterface
(new namespace). -
#83 renames
Zend\Hydrator\NamingStrategyEnabledInterface
toZend\Hydrator\NamingStrategy\NamingStrategyEnabledInterface
(new namespace). -
#83 renames
Zend\Hydrator\StrategyEnabledInterface
toZend\Hydrator\Strategy\StrategyEnabledInterface
(new namespace). -
#82 and #85 change
Zend\Hydrator\NamingStrategy\MapNamingStrategy
in 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) : MapNamingStrategy
will use the provided extraction map for extraction operations, and flip it
for hydration operations.MapNamingStrategy::createFromHydrationMap(array $hydrationMap) : MapNamingStrategy
will use the provided hydration map for hydration operations, and flip it
for extraction operations.MapNamingStrategy::createFromAssymetricMap(array $extractionMap, array $hydrationMap) : MapNamingStrategy
will use the appropriate map based on the requested operation.
- The class is now marked
-
#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 theAggregateHydrator
. -
#80 bumps the minimum supported zend-serializer version to 2.9.0. zend-serializer is
only required if you are using theSerializableStrategy
. -
#80 bumps the minimum supported zend-servicemanager version to 3.3.2.
zend-servicemanager is only required if you are using the
HydratorPluginManager
orDelegatingHydrator
. 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
:- static property
$underscoreToStudlyCaseFilter
was renamed to$underscoreToCamelCaseFilter
and markedprivate
- static property
$camelCaseToUnderscoreFilter
was markedprivate
- method
getCamelCaseToUnderscoreFilter
was markedprivate
- method
getUnderscoreToStudlyCaseFilter
was renamed togetUnderscoreToCamelCaseFilter
and markedprivate
- static property
Deprecated
- #89 and
#93 deprecate the
following classes, which will be removed in 4.0.0:Zend\Hydrator\ArraySerializable
(becomesArraySerializableHydrator
)Zend\Hydrator\ClassMethods
(becomesClassMethodsHydrator
)Zend\Hydrator\ObjectProperty
(becomesObjectPropertyHydrator
)Zend\Hydrator\Reflection
(becomesReflectionHydrator
)
Removed
-
#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 intoZend\Hydrator\NamingStrategy\MapNamingStrategy
;
useMapNamingStrategy::createFromExtractionMap()
to create an instance that
has the same functionality asArrayMapNamingStrategy
previously provided.
Fixed
- Nothing.