Changing ZF2 core 2.4.13 \Zend\Stdlib\Hydrator\AbstractHydrator::hasStrategy

class: Zend\Stdlib\Hydrator\AbstractHydrator
function: hasStrategy
php version: 7.4

public function hasStrategy($name)
{
if(is_array($this->strategies))
return array_key_exists($name, $this->strategies)
|| array_key_exists(‘*’, $this->strategies);
if(is_object($this->strategies)) return property_exists($this->strategies, $name);
return false;
}

new change / new code

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /media/shkr-home-wifi/works/workspace/vendor/ZF2/library/ Zend\Stdlib\Hydrator\AbstractHydrator on line 87

reason of change

public function hasStrategy($name)
{
return array_key_exists($name, $this->strategies)
|| array_key_exists(‘*’, $this->strategies);
}

previous code
Posted in php, zf2Tagged , , , , ,