From f25b621e5657d2c8e4b16f122db621b99d9fbb14 Mon Sep 17 00:00:00 2001 From: Mike Shiyan Date: Thu, 29 Dec 2022 21:48:14 +0200 Subject: [PATCH] Fix Unable to delegate to a ReflectionContainer (#1137) --- src/Robo.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Robo.php b/src/Robo.php index 2696076a..eefa2793 100644 --- a/src/Robo.php +++ b/src/Robo.php @@ -3,6 +3,7 @@ namespace Robo; use Composer\Autoload\ClassLoader; +use League\Container\Argument\Literal\StringArgument; use League\Container\Container; use League\Container\Definition\DefinitionInterface; use Psr\Container\ContainerInterface; @@ -331,8 +332,8 @@ public static function configureContainer(ContainerInterface $container, Symfony self::addShared($container, 'symfonyStyleInjector', \Robo\Symfony\SymfonyStyleInjector::class); self::addShared($container, 'consoleIOInjector', \Robo\Symfony\ConsoleIOInjector::class); self::addShared($container, 'parameterInjection', \Consolidation\AnnotatedCommand\ParameterInjection::class) - ->addMethodCall('register', ['Symfony\Component\Console\Style\SymfonyStyle', 'symfonyStyleInjector']) - ->addMethodCall('register', ['Robo\Symfony\ConsoleIO', 'consoleIOInjector']); + ->addMethodCall('register', [new StringArgument('Symfony\Component\Console\Style\SymfonyStyle'), 'symfonyStyleInjector']) + ->addMethodCall('register', [new StringArgument('Robo\Symfony\ConsoleIO'), 'consoleIOInjector']); self::addShared($container, 'commandProcessor', \Consolidation\AnnotatedCommand\CommandProcessor::class) ->addArgument('hookManager') ->addMethodCall('setFormatterManager', ['formatterManager'])