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
{{ message }}
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
Actually, the AbstractHydrator of v2.7.0 has BC breaks to v2.6.0 as it doesn't implement zendframework/zend-stdlib interfaces like StrategyEnabledInterface, e.g.
Therefore, any code that depends on those interfaces (e.g. by typehinting them in method definitions), cannot upgrade to v2.7.0.
Bad example but this might show the problem pretty clear:
<?php
class MyHydratorWhichAlwaysHadStrategyEnabledInterfaceFromStdlib extends \Zend\Stdlib\Hydrator\AbstractHydrator
{
// Implementation
}
class Service
{
private $hydrator;
public function __construct(MyHydratorWhichAlwaysHadStrategyEnabledInterfaceFromStdlib $hydrator)
{
// Yes we could use interface typehinting but however
$this->hydrator = $hydrator;
}
public function doSomething()
{
// do some fancy stuff
// Attach some custom strategies
$this->attachCustomStrategies($this->hydrator);
}
private function attachCustomStrategies(\Zend\Stdlib\Hydrator\StrategyEnabledInterface $hydrator)
{
// Work with that interface
}
}
Well now, the argumentation could be "Why wont you just check the interface before using the Method. Okay, I could do that, but anyways, the code wont getting executed at all then.
Proper way would be to migrate our code to the new interfaces introduced with zendframework/zend-hydrator but actually this could have side-effects in our code which contains more than a few lines.
However, any reasons why the interfaces are not implemented in zendframework/zend-stdlibAbstractHydrator? Just wondering, this would've been the best way to ensure BC.
Dont wont to start a discussion, just a little hint to understand these changes for myself.
See for reference:
phpro/zf-doctrine-hydration-module#20
also related:
zfcampus/zf-apigility-doctrine#234
The text was updated successfully, but these errors were encountered: