| Total Complexity | 7 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class CallbackEvent extends Event |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * The callback to call. |
||
| 17 | * |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | protected $callback; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * The parameters to pass to the method. |
||
| 24 | * |
||
| 25 | * @var array |
||
| 26 | */ |
||
| 27 | protected $parameters; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param string $callback |
||
| 31 | * @param array $parameters |
||
| 32 | * @param array $config |
||
| 33 | */ |
||
| 34 | public function __construct($callback, array $parameters = [], $config = []) |
||
| 35 | { |
||
| 36 | $this->callback = $callback; |
||
| 37 | $this->parameters = $parameters; |
||
| 38 | |||
| 39 | if (!is_string($this->callback) && !is_callable($this->callback)) { |
||
| 40 | throw new InvalidParamException( |
||
| 41 | 'Invalid scheduled callback event. Must be string or callable.' |
||
| 42 | ); |
||
| 43 | } |
||
| 44 | |||
| 45 | parent::__construct($config); |
||
|
|
|||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Run the given event. |
||
| 50 | * |
||
| 51 | * @param Application $app |
||
| 52 | * |
||
| 53 | * @return mixed |
||
| 54 | */ |
||
| 55 | public function run(Application $app) |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * Get the summary of the event for display. |
||
| 65 | * |
||
| 66 | * @return string |
||
| 67 | */ |
||
| 68 | public function getSummaryForDisplay() |
||
| 75 | } |
||
| 76 | } |
||
| 77 |