| Conditions | 5 |
| Paths | 16 |
| Total Lines | 25 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 19 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 25 | 8 | public function __construct(Result $result, $page = 1, $limit = self::DEFAULT_LIMIT) |
|
| 26 | { |
||
| 27 | 8 | if (!is_numeric($page)) { |
|
| 28 | 1 | $page = 1; |
|
| 29 | 1 | } |
|
| 30 | |||
| 31 | 8 | if (!is_numeric($limit)) { |
|
| 32 | 1 | $limit = self::DEFAULT_LIMIT; |
|
| 33 | 1 | } |
|
| 34 | |||
| 35 | 8 | $page = (int) $page; |
|
| 36 | 8 | $limit = (int) $limit; |
|
| 37 | |||
| 38 | 8 | if ($page < 1) { |
|
| 39 | 1 | $page = 1; |
|
| 40 | 1 | } |
|
| 41 | |||
| 42 | 8 | if ($limit < 1) { |
|
| 43 | 1 | $limit = 1; |
|
| 44 | 1 | } |
|
| 45 | |||
| 46 | 8 | $this->result = $result; |
|
| 47 | 8 | $this->page = $page; |
|
| 48 | 8 | $this->limit = $limit; |
|
| 49 | 8 | } |
|
| 50 | |||
| 103 |