| 1 | <?php |
||
| 7 | class Action |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The middleware registered on the action. |
||
| 11 | * |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | protected $middleware = []; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Register middleware on the action. |
||
| 18 | * |
||
| 19 | * @param array|string|\Closure $middleware |
||
| 20 | * @param array $options |
||
| 21 | * |
||
| 22 | * @return \PerfectOblivion\Actions\ActionMiddlewareOptions |
||
| 23 | */ |
||
| 24 | public function middleware($middleware, array $options = []) |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Get the middleware assigned to the action. |
||
| 38 | * |
||
| 39 | * @return array |
||
| 40 | */ |
||
| 41 | public function getMiddleware() |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Execute an action on the action. |
||
| 48 | * |
||
| 49 | * @param string $method |
||
| 50 | * @param array $parameters |
||
| 51 | * |
||
| 52 | * @return \Symfony\Component\HttpFoundation\Response |
||
| 53 | */ |
||
| 54 | public function callAction($method, $parameters) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Handle calls to missing methods on the action. |
||
| 61 | * |
||
| 62 | * @param string $method |
||
| 63 | * @param array $parameters |
||
| 64 | * |
||
| 65 | * @throws \BadMethodCallException |
||
| 66 | * |
||
| 67 | * @return mixed |
||
| 68 | */ |
||
| 69 | public function __call($method, $parameters) |
||
| 77 | } |
||
| 78 |