diff --git a/composer.json b/composer.json index 03344cf..e5f8946 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,10 @@ } ], "require": { - "php": "^8.2", - "micro/dependency-injection": "^1.6.4" + "micro/dependency-injection": "^1.7" + }, + "require-dev": { + "micro/testing-tool": "^1.7" }, "autoload": { "psr-4": { @@ -47,10 +49,7 @@ "@statics", "composer validate --strict", "composer normalize", - "@coverage" + "@phpunit" ] - }, - "require-dev": { - "micro/testing-tool": "^1.7" } } diff --git a/src/AutowireHelper.php b/src/AutowireHelper.php index 887e4ea..0fe0e2c 100644 --- a/src/AutowireHelper.php +++ b/src/AutowireHelper.php @@ -16,7 +16,7 @@ use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; -class AutowireHelper implements AutowireHelperInterface +readonly class AutowireHelper implements AutowireHelperInterface { public function __construct(private ContainerInterface $container) { diff --git a/src/ContainerAutowire.php b/src/ContainerAutowire.php index 47e8b21..ceae979 100644 --- a/src/ContainerAutowire.php +++ b/src/ContainerAutowire.php @@ -12,6 +12,9 @@ namespace Micro\Component\DependencyInjection\Autowire; use Micro\Component\DependencyInjection\Container; +use Micro\Component\DependencyInjection\ContainerDecoratorInterface; +use Micro\Component\DependencyInjection\ContainerInterface; +use Micro\Component\DependencyInjection\ContainerRegistryInterface; /** * @psalm-suppress UnusedClass @@ -20,8 +23,11 @@ final class ContainerAutowire extends Container { private AutowireHelperFactoryInterface $autowireHelperFactory; - public function __construct(private readonly Container $container) - { + public function __construct( + private readonly ContainerInterface& + ContainerRegistryInterface& + ContainerDecoratorInterface $container, + ) { $this->autowireHelperFactory = new AutowireHelperFactory($this->container); }