X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fhttp-kernel%2FEvent%2FFilterControllerEvent.php;fp=vendor%2Fsymfony%2Fhttp-kernel%2FEvent%2FFilterControllerEvent.php;h=e0d46aa4ce3e8a9934c0e046faf86a2ce197de07;hp=77a5c1a2ad081a488fc9eaafbf494a6b98cfdade;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/symfony/http-kernel/Event/FilterControllerEvent.php b/vendor/symfony/http-kernel/Event/FilterControllerEvent.php index 77a5c1a2a..e0d46aa4c 100644 --- a/vendor/symfony/http-kernel/Event/FilterControllerEvent.php +++ b/vendor/symfony/http-kernel/Event/FilterControllerEvent.php @@ -32,7 +32,7 @@ class FilterControllerEvent extends KernelEvent */ private $controller; - public function __construct(HttpKernelInterface $kernel, $controller, Request $request, $requestType) + public function __construct(HttpKernelInterface $kernel, callable $controller, Request $request, $requestType) { parent::__construct($kernel, $request, $requestType); @@ -53,50 +53,9 @@ class FilterControllerEvent extends KernelEvent * Sets a new controller. * * @param callable $controller - * - * @throws \LogicException */ - public function setController($controller) + public function setController(callable $controller) { - // controller must be a callable - if (!is_callable($controller)) { - throw new \LogicException(sprintf('The controller must be a callable (%s given).', $this->varToString($controller))); - } - $this->controller = $controller; } - - private function varToString($var) - { - if (is_object($var)) { - return sprintf('Object(%s)', get_class($var)); - } - - if (is_array($var)) { - $a = array(); - foreach ($var as $k => $v) { - $a[] = sprintf('%s => %s', $k, $this->varToString($v)); - } - - return sprintf('Array(%s)', implode(', ', $a)); - } - - if (is_resource($var)) { - return sprintf('Resource(%s)', get_resource_type($var)); - } - - if (null === $var) { - return 'null'; - } - - if (false === $var) { - return 'false'; - } - - if (true === $var) { - return 'true'; - } - - return (string) $var; - } }