You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can't extend it and implement Laminas\Hydrator\HydratorAwareInterface.
Current behavior
When we do that we are getting the following exception:
Fatal error: Declaration of Laminas\Form\Form::setHydrator(Laminas\Hydrator\HydratorInterface $hydrator) must be compatible with Laminas\Hydrator\HydratorAwareInterface::setHydrator(Laminas\Hydrator\HydratorInterface $hydrator): void in ...
@boesing The issue mentioned by @michalbundyra cannot be solved without dropping support for PHP <= 7.0, since you will have to add the return type void to Laminas\Form\Form::setHydrator(). Since 2.15.x still supports PHP 5.6 this cannot happen there, but with merging #75 (PHP 8.0) this should likely work for 2.16.x.
However, adding support for laminas/laminas-hydrator:^4.0 is independant from that. The 4.0 series comes with (only) one BC break, see https://github.com/laminas/laminas-hydrator/releases, which is an optional parameter ?object $instance = null in the Laminas\Hydrator\Filter\FilterInterface::filter() function. Since this package does not define any filters, I am curious if that update will affect this package at all. I guess you could add support for ^4.0 to an 2.15.1 release easily. Let me know if I should provide a PR for this.
Bug Report
Summary
There is a problem with compatibility with laminas-hydrator v3 in
Laminas\Form
class:https://github.com/laminas/laminas-form/blob/master/src/Form.php#L315
We can't extend it and implement
Laminas\Hydrator\HydratorAwareInterface
.Current behavior
When we do that we are getting the following exception:
How to reproduce
Expected behavior
It is possible to extend Form and implement interface HydratorAwareInterface.
The text was updated successfully, but these errors were encountered: