From b5f9d59c52d4788485fa1ecb01b82f6acb6c402c Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Mon, 16 Sep 2024 13:17:26 -0400 Subject: [PATCH] Fix type-safety for `ExtensionPluginManager` This fixes a few type definitions that were missing when defining instances within `ExtensionPluginManager`, resulting in a complete white-screen when `error_reporting(E_ALL)` is enabled. For instance, [`PluginManagerInterface::validate`](https://github.com/laminas/laminas-servicemanager/blob/4.3.x/src/PluginManagerInterface.php#L27) expects to return `void`. Signed-off-by: Rob Loach --- src/Reader/ExtensionPluginManager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Reader/ExtensionPluginManager.php b/src/Reader/ExtensionPluginManager.php index c065910b..745fb0b9 100644 --- a/src/Reader/ExtensionPluginManager.php +++ b/src/Reader/ExtensionPluginManager.php @@ -33,7 +33,7 @@ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionM * * @inheritDoc */ - protected $aliases = [ + protected array $aliases = [ 'atomentry' => Extension\Atom\Entry::class, 'atomEntry' => Extension\Atom\Entry::class, 'AtomEntry' => Extension\Atom\Entry::class, @@ -143,7 +143,7 @@ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionM * * @inheritDoc */ - protected $factories = [ + protected array $factories = [ Extension\Atom\Entry::class => InvokableFactory::class, Extension\Atom\Feed::class => InvokableFactory::class, Extension\Content\Entry::class => InvokableFactory::class, @@ -197,10 +197,10 @@ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionM * * @var bool */ - protected $sharedByDefault = false; + protected bool $sharedByDefault = false; /** @inheritDoc */ - public function validate(mixed $instance) + public function validate(mixed $instance) : void { if ( $instance instanceof AbstractEntry