Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/http-kernel/Controller/ControllerResolver.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
13 | 13 |
14 use Psr\Log\LoggerInterface; | 14 use Psr\Log\LoggerInterface; |
15 use Symfony\Component\HttpFoundation\Request; | 15 use Symfony\Component\HttpFoundation\Request; |
16 | 16 |
17 /** | 17 /** |
18 * ControllerResolver. | |
19 * | |
20 * This implementation uses the '_controller' request attribute to determine | 18 * This implementation uses the '_controller' request attribute to determine |
21 * the controller to execute and uses the request attributes to determine | 19 * the controller to execute and uses the request attributes to determine |
22 * the controller method arguments. | 20 * the controller method arguments. |
23 * | 21 * |
24 * @author Fabien Potencier <fabien@symfony.com> | 22 * @author Fabien Potencier <fabien@symfony.com> |
41 * | 39 * |
42 * @var bool | 40 * @var bool |
43 */ | 41 */ |
44 private $supportsScalarTypes; | 42 private $supportsScalarTypes; |
45 | 43 |
46 /** | |
47 * Constructor. | |
48 * | |
49 * @param LoggerInterface $logger A LoggerInterface instance | |
50 */ | |
51 public function __construct(LoggerInterface $logger = null) | 44 public function __construct(LoggerInterface $logger = null) |
52 { | 45 { |
53 $this->logger = $logger; | 46 $this->logger = $logger; |
54 | 47 |
55 $this->supportsVariadic = method_exists('ReflectionParameter', 'isVariadic'); | 48 $this->supportsVariadic = method_exists('ReflectionParameter', 'isVariadic'); |
221 if (!is_array($callable)) { | 214 if (!is_array($callable)) { |
222 return sprintf('Invalid type for controller given, expected string or array, got "%s".', gettype($callable)); | 215 return sprintf('Invalid type for controller given, expected string or array, got "%s".', gettype($callable)); |
223 } | 216 } |
224 | 217 |
225 if (2 !== count($callable)) { | 218 if (2 !== count($callable)) { |
226 return sprintf('Invalid format for controller, expected array(controller, method) or controller::method.'); | 219 return 'Invalid format for controller, expected array(controller, method) or controller::method.'; |
227 } | 220 } |
228 | 221 |
229 list($controller, $method) = $callable; | 222 list($controller, $method) = $callable; |
230 | 223 |
231 if (is_string($controller) && !class_exists($controller)) { | 224 if (is_string($controller) && !class_exists($controller)) { |