diff --git a/src/AdapterPluginManager.php b/src/AdapterPluginManager.php index 3f4ef54..bd48566 100644 --- a/src/AdapterPluginManager.php +++ b/src/AdapterPluginManager.php @@ -4,6 +4,7 @@ namespace Laminas\Paginator; +use Laminas\Paginator\Adapter\AdapterInterface; use Laminas\ServiceManager\AbstractPluginManager; use Laminas\ServiceManager\Exception\InvalidServiceException; use Laminas\ServiceManager\Factory\InvokableFactory; @@ -23,8 +24,10 @@ * Plugin manager implementation for paginator adapters. * * Enforces that adapters retrieved are instances of - * Adapter\AdapterInterface. Additionally, it registers a number of default + * AdapterInterface. Additionally, it registers a number of default * adapters available. + * + * @extends AbstractPluginManager */ class AdapterPluginManager extends AbstractPluginManager { @@ -97,13 +100,14 @@ class AdapterPluginManager extends AbstractPluginManager ]; /** @var string */ - protected $instanceOf = Adapter\AdapterInterface::class; + protected $instanceOf = AdapterInterface::class; /** * Validate that a plugin is an adapter (v3) * * @param mixed $instance * @throws InvalidServiceException + * @psalm-assert AdapterInterface $instance */ public function validate($instance) { @@ -111,7 +115,7 @@ public function validate($instance) throw new InvalidServiceException(sprintf( 'Plugin of type %s is invalid; must implement %s', is_object($instance) ? get_class($instance) : gettype($instance), - Adapter\AdapterInterface::class + AdapterInterface::class )); } } @@ -122,6 +126,7 @@ public function validate($instance) * @param mixed $plugin * @throws Exception\RuntimeException * @return void + * @psalm-assert AdapterInterface $instance */ public function validatePlugin($plugin) { diff --git a/src/ScrollingStylePluginManager.php b/src/ScrollingStylePluginManager.php index e174a40..f38cef6 100644 --- a/src/ScrollingStylePluginManager.php +++ b/src/ScrollingStylePluginManager.php @@ -4,6 +4,7 @@ namespace Laminas\Paginator; +use Laminas\Paginator\ScrollingStyle\ScrollingStyleInterface; use Laminas\ServiceManager\AbstractPluginManager; use Laminas\ServiceManager\Exception\InvalidServiceException; use Laminas\ServiceManager\Factory\InvokableFactory; @@ -21,8 +22,10 @@ * Plugin manager implementation for scrolling style adapters * * Enforces that adapters retrieved are instances of - * ScrollingStyle\ScrollingStyleInterface. Additionally, it registers a number + * ScrollingStyleInterface. Additionally, it registers a number * of default adapters available. + * + * @extends AbstractPluginManager */ class ScrollingStylePluginManager extends AbstractPluginManager { @@ -73,13 +76,14 @@ class ScrollingStylePluginManager extends AbstractPluginManager ]; /** @var string */ - protected $instanceOf = ScrollingStyle\ScrollingStyleInterface::class; + protected $instanceOf = ScrollingStyleInterface::class; /** * Validate a plugin (v3) * * @param mixed $instance * @throws InvalidServiceException + * @psalm-assert ScrollingStyleInterface $instance */ public function validate($instance) { @@ -87,7 +91,7 @@ public function validate($instance) throw new InvalidServiceException(sprintf( 'Plugin of type %s is invalid; must implement %s', is_object($instance) ? get_class($instance) : gettype($instance), - Adapter\AdapterInterface::class + ScrollingStyleInterface::class )); } } @@ -98,6 +102,7 @@ public function validate($instance) * @param mixed $plugin * @throws Exception\InvalidArgumentException * @return void + * @psalm-assert ScrollingStyleInterface $instance */ public function validatePlugin($plugin) {