Skip to content

Commit 61ad026

Browse files
committed
Optimize perf by replacing call_user_func with dynamic vars
1 parent 3fac676 commit 61ad026

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ContainerBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ private function createService(Definition $definition, array &$inlineServices, $
11601160
throw new InvalidArgumentException(sprintf('The configure callable for class "%s" is not a callable.', \get_class($service)));
11611161
}
11621162

1163-
\call_user_func($callable, $service);
1163+
$callable($service);
11641164
}
11651165

11661166
return $service;

LazyProxy/Instantiator/RealServiceInstantiator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ class RealServiceInstantiator implements InstantiatorInterface
2828
*/
2929
public function instantiateProxy(ContainerInterface $container, Definition $definition, $id, $realInstantiator)
3030
{
31-
return \call_user_func($realInstantiator);
31+
return $realInstantiator();
3232
}
3333
}

Loader/ClosureLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(ContainerBuilder $container)
3535
*/
3636
public function load($resource, $type = null)
3737
{
38-
\call_user_func($resource, $this->container);
38+
$resource($this->container);
3939
}
4040

4141
/**

0 commit comments

Comments
 (0)