| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function toResponse($request) |
||
| 23 | { |
||
| 24 | if ($this->resource instanceof AbstractPaginator) { |
||
|
|
|||
| 25 | return (new PaginatedResourceResponse($this))->toResponse($request); |
||
| 26 | } |
||
| 27 | if ($this->resource instanceof PaginationResult) { |
||
| 28 | return (new PaginationResultResourceResponse($this))->toResponse($request); |
||
| 29 | } |
||
| 30 | |||
| 31 | return parent::toResponse($request); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: