laminas/laminas-hydrator
Laminas Hydrator provides flexible tools to hydrate and extract data between arrays and objects. Includes hydrator strategies, naming conventions, and integration helpers for forms and domain models, supporting multiple hydrator implementations and extensions.
This document details changes made between version 3 and version 4 that could affect end-users.
The Laminas\Hydrator\Filter\FilterInterface::filter() method changed signature to accept an optional second argument:
namespace Laminas\Hydrator\Filter;
interface FilterInterface
{
public function filter(string $property, ?object $instance = null) : bool;
}
The primary use case for this is when using anonymous objects, to facilitate reflection; the ClassMethodsHydrator, for instance, was updated to pass the $instance value only when an anonymous object is detected.
All filter implementations have been updated to the new signature.
All filters implementing Laminas\Hydrator\Filter\FilterInterface shipped with the package are now marked final.
If you were previously extending these classes, you will need to copy and paste the implementations; if you feel there is a general-purpose use case for extending the class, please open a feature request to remove the final keyword on the specific implementation you are interested in.
How can I help you explore Laravel packages today?