diff --git a/composer.json b/composer.json index 9aa1914..35c3ce9 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "require": { "php": "^7.2", "symfony/dependency-injection": "^4.3 || ^5.0", - "symfony/http-kernel": "^4.3 || ^5.0", + "symfony/http-kernel": "^4.3 || ^5.1.5", "jeckel-lab/command-dispatcher": "^0.3", "symfony/config": "^4.3 || ^5.0", "symfony/doctrine-bridge": "^4.3 || ^5.0", @@ -14,7 +14,7 @@ , "require-dev": { "roave/security-advisories": "dev-master", - "vimeo/psalm": "^3.8", + "vimeo/psalm": "^4.1", "phpmd/phpmd": "^2.8", "squizlabs/php_codesniffer": "^3.5", "phpro/grumphp": "^0.19.0" diff --git a/psalm.xml b/psalm.xml index 42f355b..4e9226b 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Compiler/CommandHandlerPass.php b/src/Compiler/CommandHandlerPass.php index 112371b..1ae679f 100644 --- a/src/Compiler/CommandHandlerPass.php +++ b/src/Compiler/CommandHandlerPass.php @@ -41,15 +41,15 @@ public function process(ContainerBuilder $container): void $handlerMaps = []; // Find command handlers foreach (array_keys($container->findTaggedServiceIds($this->handlersTag)) as $serviceId) { - $classname = $container->getDefinition($serviceId)->getClass(); + $classname = $container->getDefinition((string) $serviceId)->getClass(); if (null === $classname) { throw new RuntimeException(sprintf('Unable to find service with id: %s', $serviceId)); } $aliasId = 'command_handler.handler.alias.' . $classname; - $container->setAlias($aliasId, $serviceId)->setPublic(true); + $container->setAlias($aliasId, (string) $serviceId)->setPublic(true); - /** @var array $commands */ + /** @var string[] $commands */ $commands = call_user_func([$classname, 'getHandledCommands']); foreach ($commands as $command) { $handlerMaps[$command] = $aliasId;