Drop Interop container and move service manager from dev to require
MODIFY
composer.json
composer.json
},
"require": {
"php": "^7.4 || ~8.0.0 || ~8.1.0",
- "container-interop/container-interop": "^1.1",
+ "laminas/laminas-servicemanager": "^3.12.0",
"laminas/laminas-stdlib": "^3.10"
},
"require-dev": {
"laminas/laminas-http": "^2.14.2",
"laminas/laminas-i18n": "^2.15.0",
"laminas/laminas-math": "^2.7.1",
- "laminas/laminas-servicemanager": "^3.12.0",
"laminas/laminas-session": "^2.12.1",
"laminas/laminas-uri": "^2.9.1",
"phpspec/prophecy-phpunit": "^2.0",

MODIFY
composer.lock
composer.lock
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "9c648cb7391ef85eac6ec4b3dfc37651",
+ "content-hash": "0eb1f1c3bae821da3c13e1e504414c93",
"packages": [
{
"name": "laminas/laminas-servicemanager",

MODIFY
psalm-baseline.xml
psalm-baseline.xml
<MixedAssignment occurrences="1">
<code>$validator</code>
</MixedAssignment>
- <MixedMethodCall occurrences="5">
- <code>get</code>
- <code>get</code>
+ <MixedMethodCall occurrences="1">
<code>getValidatorPluginManager</code>
- <code>setInvokableClass</code>
- <code>setService</code>
</MixedMethodCall>
- <UndefinedThisPropertyAssignment occurrences="1">
- <code>$this-&gt;validators</code>
- </UndefinedThisPropertyAssignment>
- <UndefinedThisPropertyFetch occurrences="3">
- <code>$this-&gt;validators</code>
- <code>$this-&gt;validators</code>
- <code>$this-&gt;validators</code>
- </UndefinedThisPropertyFetch>
</file>
<file src="test/_files/MyBarcode1.php">
<UndefinedFunction occurrences="1">

MODIFY
src/ValidatorPluginManager.php
src/ValidatorPluginManager.php
namespace Laminas\Validator;
-use Interop\Container\ContainerInterface; // phpcs:ignore
use Laminas\I18n\Validator as I18nValidator;
use Laminas\ServiceManager\AbstractPluginManager;
use Laminas\ServiceManager\ConfigInterface;
use Laminas\ServiceManager\Exception\InvalidServiceException;
use Laminas\ServiceManager\Factory\InvokableFactory;
use Laminas\ServiceManager\ServiceManager;
+use Psr\Container\ContainerInterface;
use Zend\I18n\Validator\Alnum;
use Zend\I18n\Validator\Alpha;
use Zend\I18n\Validator\DateTime;

MODIFY
src/ValidatorPluginManagerFactory.php
src/ValidatorPluginManagerFactory.php
namespace Laminas\Validator;
-use Interop\Container\ContainerInterface; // phpcs:ignore
use Laminas\ServiceManager\Config;
use Laminas\ServiceManager\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Laminas\ServiceManager\ServiceManager;
+use Psr\Container\ContainerInterface;
use function is_array;

MODIFY
test/ValidatorPluginManagerFactoryTest.php
test/ValidatorPluginManagerFactoryTest.php
namespace LaminasTest\Validator;
-use Interop\Container\ContainerInterface; // phpcs:ignore
use Laminas\ServiceManager\ServiceLocatorInterface;
use Laminas\Validator\Digits;
use Laminas\Validator\ValidatorInterface;
@@ -10,6 +9,7 @@ use Laminas\Validator\ValidatorPluginManager;
use Laminas\Validator\ValidatorPluginManagerFactory;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
+use Psr\Container\ContainerInterface;
class ValidatorPluginManagerFactoryTest extends TestCase
{

MODIFY
test/ValidatorPluginManagerTest.php
test/ValidatorPluginManagerTest.php
namespace LaminasTest\Validator;
use Exception;
-use Interop\Container\ContainerInterface; // phpcs:ignore
use Laminas\ServiceManager\Exception\InvalidServiceException;
use Laminas\ServiceManager\ServiceManager;
use Laminas\Validator\AbstractValidator;
@@ -13,6 +12,7 @@ use Laminas\Validator\ValidatorInterface;
use Laminas\Validator\ValidatorPluginManager;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
+use Psr\Container\ContainerInterface;
use function get_class;
use function sprintf;
@@ -24,6 +24,8 @@ class ValidatorPluginManagerTest extends TestCase
{
use ProphecyTrait;
+ private ValidatorPluginManager $validators;
+
protected function setUp(): void
{
$this->validators = new ValidatorPluginManager(new ServiceManager());
@@ -59,6 +61,7 @@ class ValidatorPluginManagerTest extends TestCase
public function testRegisteringInvalidValidatorRaisesException(): void
{
try {
+ /** @psalm-suppress InvalidArgument */
$this->validators->setService('test', $this);
} catch (InvalidServiceException $e) {
$this->assertStringContainsString(ValidatorInterface::class, $e->getMessage());

Drop Interop container and move service manager from dev to require

Signed-off-by: George Steel <george@net-glue.co.uk>