diff options
Diffstat (limited to 'vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php')
| -rw-r--r-- | vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php b/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php index 125464b123..64d5e02473 100644 --- a/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php +++ b/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php @@ -49,7 +49,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface } $parameterBag = $container->getParameterBag(); - $controllers = array(); + $controllers = []; foreach ($container->findTaggedServiceIds($this->controllerTag, true) as $id => $tags) { $def = $container->getDefinition($id); @@ -72,14 +72,14 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface $isContainerAware = $r->implementsInterface(ContainerAwareInterface::class) || is_subclass_of($class, AbstractController::class); // get regular public methods - $methods = array(); - $arguments = array(); + $methods = []; + $arguments = []; foreach ($r->getMethods(\ReflectionMethod::IS_PUBLIC) as $r) { if ('setContainer' === $r->name && $isContainerAware) { continue; } if (!$r->isConstructor() && !$r->isDestructor() && !$r->isAbstract()) { - $methods[strtolower($r->name)] = array($r, $r->getParameters()); + $methods[strtolower($r->name)] = [$r, $r->getParameters()]; } } @@ -89,7 +89,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface $autowire = true; continue; } - foreach (array('action', 'argument', 'id') as $k) { + foreach (['action', 'argument', 'id'] as $k) { if (!isset($attributes[$k][0])) { throw new InvalidArgumentException(sprintf('Missing "%s" attribute on tag "%s" %s for service "%s".', $k, $this->controllerTag, json_encode($attributes, JSON_UNESCAPED_UNICODE), $id)); } @@ -119,7 +119,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface /** @var \ReflectionMethod $r */ // create a per-method map of argument-names to service/type-references - $args = array(); + $args = []; foreach ($parameters as $p) { /** @var \ReflectionParameter $p */ $type = ltrim($target = ProxyHelper::getTypeHint($r, $p), '\\'); @@ -138,13 +138,13 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface $binding = $bindings[$bindingName]; list($bindingValue, $bindingId) = $binding->getValues(); - $binding->setValues(array($bindingValue, $bindingId, true)); + $binding->setValues([$bindingValue, $bindingId, true]); if (!$bindingValue instanceof Reference) { $args[$p->name] = new Reference('.value.'.$container->hash($bindingValue)); $container->register((string) $args[$p->name], 'mixed') ->setFactory('current') - ->addArgument(array($bindingValue)); + ->addArgument([$bindingValue]); } else { $args[$p->name] = $bindingValue; } |
