-
-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Bug Report
| Q | A |
|---|---|
| Version(s) | 4.15.0 |
Summary
This issue appeared after updating laminas/laminas-servicemanager to v4
Error message:
Type of Laminas\\Hydrator\\HydratorPluginManager::$sharedByDefault must be bool (as in class Laminas\\ServiceManager\\AbstractPluginManager
)","file":"/var/www/vendor/laminas/laminas-hydrator/src/HydratorPluginManager.php
In the new version of Laminas\ServiceManager\AbstractPluginManager, properties have type declarations:
protected bool $sharedByDefault = true;
Laminas\Hydrator\HydratorPluginManager extends Laminas\ServiceManager\AbstractPluginManager, but its properties are only typed through annotations:
/**
* Whether or not to share by default (v3)
*
* @var bool
*/
protected $sharedByDefault = false;
Composer allows the installation of laminas/laminas-servicemanager version 4 because it is only a development requirement: https://packagist.org/packages/laminas/laminas-hydrator#4.15.0
Current behavior
The issue does not occur with laminas/laminas-servicemanager version 3.
How to reproduce
Update laminas/laminas-servicemanager to version 4, then observe a crash during the initialization of Laminas\Hydrator\HydratorPluginManager in Laminas\Hydrator\HydratorPluginManagerFactory
$pluginManager = new HydratorPluginManager($container, $options ?? []);
Expected behavior
The HydratorPluginManager should be initialized without type conflicts.