Skip to content

Instantly share code, notes, and snippets.

@nicolas-grekas
Created November 8, 2018 10:54
Show Gist options
  • Save nicolas-grekas/d2612166b11e5cef6ef0f7adf334ae10 to your computer and use it in GitHub Desktop.
Save nicolas-grekas/d2612166b11e5cef6ef0f7adf334ae10 to your computer and use it in GitHub Desktop.
Autowiring aliases for named parameters
--- a/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php
+++ b/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php
@@ -193,7 +193,7 @@ class AutowirePass extends AbstractRecursivePass
continue;
}
- $type = ProxyHelper::getTypeHint($reflectionMethod, $parameter, true);
+ $type = ltrim(ProxyHelper::getTypeHint($reflectionMethod, $parameter, false), '\\');
if (!$type) {
if (isset($arguments[$index])) {
services:
string $toto:
class: string
factory: 'current'
arguments: [['HELLO']]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment