Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
38 */ | 38 */ |
39 public function getController(Request $request) | 39 public function getController(Request $request) |
40 { | 40 { |
41 $controller = parent::getController($request); | 41 $controller = parent::getController($request); |
42 | 42 |
43 if (is_array($controller) && isset($controller[0]) && is_string($controller[0]) && $this->container->has($controller[0])) { | 43 if (\is_array($controller) && isset($controller[0]) && \is_string($controller[0]) && $this->container->has($controller[0])) { |
44 $controller[0] = $this->instantiateController($controller[0]); | 44 $controller[0] = $this->instantiateController($controller[0]); |
45 } | 45 } |
46 | 46 |
47 return $controller; | 47 return $controller; |
48 } | 48 } |
75 throw new \LogicException(sprintf('Controller not found: service "%s" does not exist.', $controller)); | 75 throw new \LogicException(sprintf('Controller not found: service "%s" does not exist.', $controller)); |
76 } | 76 } |
77 | 77 |
78 $service = $this->container->get($controller); | 78 $service = $this->container->get($controller); |
79 if (null !== $method) { | 79 if (null !== $method) { |
80 return array($service, $method); | 80 return [$service, $method]; |
81 } | 81 } |
82 | 82 |
83 if (!method_exists($service, '__invoke')) { | 83 if (!method_exists($service, '__invoke')) { |
84 throw new \LogicException(sprintf('Controller "%s" cannot be called without a method name. Did you forget an "__invoke" method?', $controller)); | 84 throw new \LogicException(sprintf('Controller "%s" cannot be called without a method name. Did you forget an "__invoke" method?', $controller)); |
85 } | 85 } |