diff --git a/composer.lock b/composer.lock index 86651e17..78704286 100644 --- a/composer.lock +++ b/composer.lock @@ -1978,16 +1978,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.5.21", + "version": "10.5.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ac837816fa52078f7a5e17ed774f256a72a51af6" + "reference": "8afb89b399b17c2ce2618015bdc9f81a117c5ee1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ac837816fa52078f7a5e17ed774f256a72a51af6", - "reference": "ac837816fa52078f7a5e17ed774f256a72a51af6", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8afb89b399b17c2ce2618015bdc9f81a117c5ee1", + "reference": "8afb89b399b17c2ce2618015bdc9f81a117c5ee1", "shasum": "" }, "require": { @@ -2059,7 +2059,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.22" }, "funding": [ { @@ -2075,7 +2075,7 @@ "type": "tidelift" } ], - "time": "2024-06-15T09:13:15+00:00" + "time": "2024-06-19T05:29:34+00:00" }, { "name": "psalm/plugin-phpunit", diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 2156e7ab..1fa0594a 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1706,28 +1706,18 @@ - - + + - - - - - - get('MvcTranslator')]]> - - - - - - - - - getServiceLocator()]]> - + + + + + + @@ -1735,18 +1725,9 @@ - - - - - - - - - @@ -1754,6 +1735,10 @@ + + + + @@ -1874,6 +1859,9 @@ + + + @@ -2221,6 +2209,9 @@ + + + @@ -2442,6 +2433,9 @@ + + + @@ -2538,6 +2532,11 @@ + + + + + diff --git a/src/ValidatorPluginManagerFactory.php b/src/ValidatorPluginManagerFactory.php index d85e25d3..5980a1c0 100644 --- a/src/ValidatorPluginManagerFactory.php +++ b/src/ValidatorPluginManagerFactory.php @@ -16,14 +16,6 @@ */ final class ValidatorPluginManagerFactory { - /** - * {@inheritDoc} - * - * @param string $name - * @param ServiceManagerConfiguration|null $options - * @return ValidatorPluginManager - * @psalm-suppress MoreSpecificImplementedParamType - */ public function __invoke(ContainerInterface $container): ValidatorPluginManager { // If this is in a laminas-mvc application, the ServiceListener will inject diff --git a/test/StaticAnalysis/PluginManager.php b/test/StaticAnalysis/PluginManager.php index 062a3ecd..b732c455 100644 --- a/test/StaticAnalysis/PluginManager.php +++ b/test/StaticAnalysis/PluginManager.php @@ -4,6 +4,7 @@ namespace LaminasTest\Validator\StaticAnalysis; +use Laminas\ServiceManager\ServiceManager; use Laminas\Validator\Uuid; use Laminas\Validator\ValidatorInterface; use Laminas\Validator\ValidatorPluginManager; @@ -13,13 +14,13 @@ final class PluginManager { public function validateAssertsPluginType(mixed $input): ValidatorInterface { - (new ValidatorPluginManager())->validate($input); + (new ValidatorPluginManager(new ServiceManager()))->validate($input); return $input; } public function getWithClassStringReturnsCorrectInstanceType(): ValidatorInterface { - return (new ValidatorPluginManager())->get(Uuid::class); + return (new ValidatorPluginManager(new ServiceManager()))->get(Uuid::class); } } diff --git a/test/ValidatorPluginManagerCompatibilityTest.php b/test/ValidatorPluginManagerCompatibilityTest.php index 62d64615..35344f67 100644 --- a/test/ValidatorPluginManagerCompatibilityTest.php +++ b/test/ValidatorPluginManagerCompatibilityTest.php @@ -7,7 +7,6 @@ use Laminas\ServiceManager\AbstractSingleInstancePluginManager; use Laminas\ServiceManager\ServiceManager; use Laminas\ServiceManager\Test\CommonPluginManagerTrait; -use Laminas\Validator\Exception\RuntimeException; use Laminas\Validator\ValidatorInterface; use Laminas\Validator\ValidatorPluginManager; use PHPUnit\Framework\TestCase; @@ -33,11 +32,6 @@ protected static function getPluginManager(array $config = []): AbstractSingleIn return new ValidatorPluginManager(new ServiceManager(), $config); } - protected function getV2InvalidPluginException(): string - { - return RuntimeException::class; - } - protected function getInstanceOf(): string { return ValidatorInterface::class; diff --git a/test/ValidatorPluginManagerFactoryTest.php b/test/ValidatorPluginManagerFactoryTest.php index cc0f37fa..a2907d11 100644 --- a/test/ValidatorPluginManagerFactoryTest.php +++ b/test/ValidatorPluginManagerFactoryTest.php @@ -10,7 +10,6 @@ use Laminas\Validator\ValidatorPluginManager; use Laminas\Validator\ValidatorPluginManagerFactory; use LaminasTest\Validator\TestAsset\InMemoryContainer; -use PHPUnit\Framework\Attributes\Depends; use PHPUnit\Framework\TestCase; final class ValidatorPluginManagerFactoryTest extends TestCase @@ -18,7 +17,7 @@ final class ValidatorPluginManagerFactoryTest extends TestCase public function testFactoryReturnsPluginManager(): void { $factory = new ValidatorPluginManagerFactory(); - $validators = $factory(new InMemoryContainer(), ValidatorPluginManagerFactory::class); + $validators = $factory(new InMemoryContainer()); self::assertInstanceOf(ValidatorPluginManager::class, $validators); } @@ -41,7 +40,7 @@ public function testConfiguresValidatorServicesWhenFound(): void $container->set('config', $config); $factory = new ValidatorPluginManagerFactory(); - $validators = $factory($container, 'ValidatorManager'); + $validators = $factory($container); self::assertInstanceOf(ValidatorPluginManager::class, $validators); self::assertTrue($validators->has('test')); @@ -66,7 +65,7 @@ public function testDoesNotConfigureValidatorServicesWhenServiceListenerPresent( ->with('config'); $factory = new ValidatorPluginManagerFactory(); - $validators = $factory($container, 'ValidatorManager'); + $validators = $factory($container); self::assertInstanceOf(ValidatorPluginManager::class, $validators); self::assertFalse($validators->has('test')); @@ -77,7 +76,7 @@ public function testDoesNotConfigureValidatorServicesWhenConfigServiceNotPresent { $container = new InMemoryContainer(); $factory = new ValidatorPluginManagerFactory(); - $validators = $factory($container, 'ValidatorManager'); + $validators = $factory($container); self::assertInstanceOf(ValidatorPluginManager::class, $validators); } @@ -87,7 +86,7 @@ public function testDoesNotConfigureValidatorServicesWhenConfigServiceDoesNotCon $container = new InMemoryContainer(); $container->set('config', ['foo' => 'bar']); $factory = new ValidatorPluginManagerFactory(); - $validators = $factory($container, 'ValidatorManager'); + $validators = $factory($container); self::assertInstanceOf(ValidatorPluginManager::class, $validators); self::assertFalse($validators->has('foo'));