| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function paginate($perPage) |
||
| 18 | { |
||
| 19 | $this->rawPerPage = $perPage; |
||
| 20 | |||
| 21 | $storedPerPage = $this->getPerPageParam(); |
||
| 22 | if (is_array($perPage)) { |
||
| 23 | $perPage = array_shift($perPage); |
||
| 24 | } |
||
| 25 | if (!$storedPerPage) { |
||
| 26 | $this->setPerPageParam($perPage ?: $this->repo()->perPage()); |
||
| 27 | $storedPerPage = $perPage; |
||
| 28 | } |
||
| 29 | $this->repo()->perPage($storedPerPage); |
||
| 30 | |||
| 31 | return $this; |
||
| 32 | } |
||
| 33 | |||
| 38 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.