Permalink
Browse files

Container: removed leading __ from anonymous method names

  • Loading branch information...
dg committed Oct 30, 2018
1 parent 3b3b1b5 commit 2a7e1d055a9b86bed82ebcdf068e8597039f6619
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/DI/Container.php
@@ -272,7 +272,8 @@ public function callMethod(callable $function, array $args = [])
public static function getMethodName(string $name): string
{
$uname = ucfirst($name);
return 'createService' . ($name === $uname ? '__' : '') . str_replace('.', '__', $uname);
return 'createService'
. (preg_match('#^[A-Z]#', $name) ? '__' : '')
. str_replace('.', '__', ucfirst($name));
}
}

0 comments on commit 2a7e1d0

Please sign in to comment.