ControllerArgumentsEvent.php
2 years ago
ControllerEvent.php
2 years ago
ExceptionEvent.php
1 year ago
FinishRequestEvent.php
2 years ago
KernelEvent.php
1 year ago
RequestEvent.php
2 years ago
ResponseEvent.php
2 years ago
TerminateEvent.php
2 years ago
ViewEvent.php
2 years ago
ControllerEvent.php
43 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | namespace Matomo\Dependencies\Symfony\Component\HttpKernel\Event; |
| 12 | |
| 13 | use Matomo\Dependencies\Symfony\Component\HttpFoundation\Request; |
| 14 | use Matomo\Dependencies\Symfony\Component\HttpKernel\HttpKernelInterface; |
| 15 | /** |
| 16 | * Allows filtering of a controller callable. |
| 17 | * |
| 18 | * You can call getController() to retrieve the current controller. With |
| 19 | * setController() you can set a new controller that is used in the processing |
| 20 | * of the request. |
| 21 | * |
| 22 | * Controllers should be callables. |
| 23 | * |
| 24 | * @author Bernhard Schussek <bschussek@gmail.com> |
| 25 | */ |
| 26 | final class ControllerEvent extends KernelEvent |
| 27 | { |
| 28 | private $controller; |
| 29 | public function __construct(HttpKernelInterface $kernel, callable $controller, Request $request, ?int $requestType) |
| 30 | { |
| 31 | parent::__construct($kernel, $request, $requestType); |
| 32 | $this->setController($controller); |
| 33 | } |
| 34 | public function getController() : callable |
| 35 | { |
| 36 | return $this->controller; |
| 37 | } |
| 38 | public function setController(callable $controller) : void |
| 39 | { |
| 40 | $this->controller = $controller; |
| 41 | } |
| 42 | } |
| 43 |