Luciano Andrade преди 8 години
родител
ревизия
43a122a0f7
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php

+ 3 - 1
DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php

@@ -270,6 +270,8 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
      */
     protected function camelize($property)
     {
-        return preg_replace(array('/(^|_)+(.)/e', '/\.(.)/e'), array("strtoupper('\\2')", "'_'.strtoupper('\\1')"), $property);
+	return preg_replace_callback('/(^|[_. ])+(.)/', function ($match) {
+		return ('.' === $match[1] ? '_' : '') . strtoupper($match[2]);
+	}, $property);
     }
 }