| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 4 | protected function toResponse( $response ) { |
|
| 31 | 4 | if ( is_string( $response ) ) { |
|
|
|
|||
| 32 | 1 | return $this->getResponseService()->output( $response ); |
|
| 33 | } |
||
| 34 | |||
| 35 | 3 | if ( is_array( $response ) ) { |
|
| 36 | 1 | return $this->getResponseService()->json( $response ); |
|
| 37 | } |
||
| 38 | |||
| 39 | 2 | if ( $response instanceof ResponsableInterface ) { |
|
| 40 | 1 | return $response->toResponse(); |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | return $response; |
|
| 44 | } |
||
| 46 |