| Total Complexity | 9 |
| Total Lines | 74 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 5 | class Meta extends BaseModel |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var array |
||
| 9 | */ |
||
| 10 | public $pagination; |
||
| 11 | |||
| 12 | 53 | public function __construct(array $data = []) |
|
| 13 | { |
||
| 14 | 53 | $this->pagination = (object) ($data['pagination'] ?? []); |
|
|
|
|||
| 15 | } |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @return int |
||
| 19 | */ |
||
| 20 | 5 | public function page() |
|
| 21 | { |
||
| 22 | 5 | return $this->pagination->page ?? null; |
|
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @return int |
||
| 27 | */ |
||
| 28 | 5 | public function limit() |
|
| 29 | { |
||
| 30 | 5 | return $this->pagination->limit ?? null; |
|
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return int |
||
| 35 | */ |
||
| 36 | 5 | public function pages() |
|
| 37 | { |
||
| 38 | 5 | return $this->pagination->pages ?? null; |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return int |
||
| 43 | */ |
||
| 44 | 5 | public function total() |
|
| 45 | { |
||
| 46 | 5 | return $this->pagination->total ?? null; |
|
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return bool |
||
| 51 | */ |
||
| 52 | 6 | public function hasNext() |
|
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return int |
||
| 59 | */ |
||
| 60 | 6 | public function next() |
|
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @return bool |
||
| 67 | */ |
||
| 68 | 6 | public function hasPrev() |
|
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @return int |
||
| 75 | */ |
||
| 76 | 6 | public function prev() |
|
| 81 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..