task: #3558292 Support passing container parameters with the Autowire...
task: #3558292 Support passing container parameters with the Autowire attribute in AutowireTrait and AutowiredInstanceTrait
By: godotislate
By: longwave
(cherry picked from commit 73c6e0ac)
@@ -77,7 +87,7 @@ private static function getAutowireArguments(ContainerInterface $container, arra
continue;
}
thrownewAutowiringFailedException($service,sprintf('Cannot autowire service "%s": argument "$%s" of method "%s::%s()". Check that either the argument type is correct or the Autowire attribute is passed a valid identifier. Otherwise configure its value explicitly if possible.',$service,$parameter->getName(),static::class,$method_name));
thrownewAutowiringFailedException($argument,sprintf('Cannot autowire %s "%s": argument "$%s" of method "%s::%s()". Check that either the argument type is correct or the Autowire attribute is passed a valid identifier. Otherwise configure its value explicitly if possible.',$type,$argument,$parameter->getName(),static::class,$method_name));
$this->expectExceptionMessage('Cannot autowire service "stdClass": argument "$service" of method "Drupal\Tests\Core\DependencyInjection\AutowireRequiredServiceTestClass::__construct()". Check that either the argument type is correct or the Autowire attribute is passed a valid identifier. Otherwise configure its value explicitly if possible.');
$this->expectExceptionMessage('Cannot autowire parameter "missing.parameter": argument "$parameter" of method "Drupal\Tests\Core\DependencyInjection\AutowireRequiredParameterTestClass::__construct()". Check that either the argument type is correct or the Autowire attribute is passed a valid identifier. Otherwise configure its value explicitly if possible.');