|
19 | 19 | use Symfony\Component\DependencyInjection\ContainerBuilder;
|
20 | 20 | use Symfony\Component\DependencyInjection\ContainerInterface;
|
21 | 21 | use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
22 |
| -use Symfony\Component\DependencyInjection\LazyProxy\ProxyHelper; |
23 | 22 | use Symfony\Component\DependencyInjection\Reference;
|
24 | 23 | use Symfony\Component\DependencyInjection\TypedReference;
|
25 | 24 | use Symfony\Component\HttpFoundation\Request;
|
26 | 25 | use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
| 26 | +use Symfony\Component\VarExporter\ProxyHelper; |
27 | 27 |
|
28 | 28 | /**
|
29 | 29 | * Creates the service-locators required by ServiceValueResolver.
|
@@ -120,7 +120,7 @@ public function process(ContainerBuilder $container)
|
120 | 120 | $args = [];
|
121 | 121 | foreach ($parameters as $p) {
|
122 | 122 | /** @var \ReflectionParameter $p */
|
123 |
| - $type = ltrim($target = (string) ProxyHelper::getTypeHint($r, $p), '\\'); |
| 123 | + $type = preg_replace('/(^|[(|&])\\\\/', '\1', $target = ltrim(ProxyHelper::exportType($p) ?? '', '?')); |
124 | 124 | $invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
|
125 | 125 | $autowireAttributes = $autowire ? $emptyAutowireAttributes : [];
|
126 | 126 |
|
@@ -183,7 +183,7 @@ public function process(ContainerBuilder $container)
|
183 | 183 |
|
184 | 184 | $args[$p->name] = new Reference($erroredId, ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE);
|
185 | 185 | } else {
|
186 |
| - $target = ltrim($target, '\\'); |
| 186 | + $target = preg_replace('/(^|[(|&])\\\\/', '\1', $target); |
187 | 187 | $args[$p->name] = $type ? new TypedReference($target, $type, $invalidBehavior, Target::parseName($p)) : new Reference($target, $invalidBehavior);
|
188 | 188 | }
|
189 | 189 | }
|
|
0 commit comments