| 1 | <?php |
||
| 10 | class ControllerEvent extends SimpleEvent |
||
| 11 | { |
||
| 12 | private $callback; |
||
| 13 | private $arguments; |
||
| 14 | |||
| 15 | public function __construct($callback, array $arguments = []) |
||
| 16 | { |
||
| 17 | $this->callback = $callback; |
||
| 18 | $this->arguments = $arguments; |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @codeCoverageIgnore |
||
| 23 | * |
||
| 24 | * @return mixed |
||
| 25 | */ |
||
| 26 | public function callback() |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @codeCoverageIgnore |
||
| 33 | * |
||
| 34 | * Set new callback to ControllerEvent. It must be callable. |
||
| 35 | * |
||
| 36 | * @param mixed $callback |
||
| 37 | */ |
||
| 38 | public function setCallback($callback): void |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @codeCoverageIgnore |
||
| 45 | * |
||
| 46 | * @return array |
||
| 47 | */ |
||
| 48 | public function arguments(): array |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @codeCoverageIgnore |
||
| 55 | * |
||
| 56 | * Sets new list of arguments to ControllerEvent. |
||
| 57 | * |
||
| 58 | * @param array $arguments |
||
| 59 | */ |
||
| 60 | public function setArguments(array $arguments = []): void |
||
| 64 | } |
||
| 65 |