| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | 4 | public function execute() { |
|
| 45 | 4 | $arguments = func_get_args(); |
|
| 46 | 4 | $response = call_user_func_array( [$this->handler, 'execute'], $arguments ); |
|
| 47 | |||
| 48 | 4 | if ( is_string( $response ) ) { |
|
| 49 | 1 | return Response::output( $response ); |
|
| 50 | } |
||
| 51 | |||
| 52 | 3 | if ( is_array( $response ) ) { |
|
| 53 | 1 | return Response::json( $response ); |
|
| 54 | } |
||
| 55 | |||
| 56 | 2 | if ( $response instanceof ConvertibleToResponseInterface ) { |
|
| 57 | 1 | return $response->toResponse(); |
|
| 58 | } |
||
| 59 | |||
| 60 | 1 | return $response; |
|
| 61 | } |
||
| 62 | } |
||
| 63 |