| Total Complexity | 9 |
| Total Lines | 116 |
| Duplicated Lines | 0 % |
| Coverage | 53.85% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class PaginationRequest |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var int |
||
| 20 | */ |
||
| 21 | protected $first; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var int |
||
| 25 | */ |
||
| 26 | protected $last; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var string |
||
| 30 | */ |
||
| 31 | protected $after; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var string |
||
| 35 | */ |
||
| 36 | protected $before; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * PaginationRequest constructor. |
||
| 40 | * |
||
| 41 | * @param string $first |
||
| 42 | * @param string $last |
||
| 43 | * @param string $after |
||
| 44 | * @param string $before |
||
| 45 | */ |
||
| 46 | 10 | public function __construct($first, $last, $after, $before) |
|
| 47 | { |
||
| 48 | 10 | $this->first = $first; |
|
|
|
|||
| 49 | 10 | $this->last = $last; |
|
| 50 | 10 | $this->after = $after; |
|
| 51 | 10 | $this->before = $before; |
|
| 52 | 10 | } |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @return int |
||
| 56 | */ |
||
| 57 | 10 | public function getFirst(): ?int |
|
| 58 | { |
||
| 59 | 10 | return $this->first; |
|
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param int $first |
||
| 64 | * |
||
| 65 | * @return PaginationRequest |
||
| 66 | */ |
||
| 67 | public function setFirst(int $first): PaginationRequest |
||
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * @return int |
||
| 76 | */ |
||
| 77 | 10 | public function getLast(): ?int |
|
| 78 | { |
||
| 79 | 10 | return $this->last; |
|
| 80 | } |
||
| 81 | |||
| 82 | /** |
||
| 83 | * @param int $last |
||
| 84 | * |
||
| 85 | * @return PaginationRequest |
||
| 86 | */ |
||
| 87 | public function setLast(int $last): PaginationRequest |
||
| 92 | } |
||
| 93 | |||
| 94 | /** |
||
| 95 | * @return string |
||
| 96 | */ |
||
| 97 | 8 | public function getAfter(): ?string |
|
| 98 | { |
||
| 99 | 8 | return $this->after; |
|
| 100 | } |
||
| 101 | |||
| 102 | /** |
||
| 103 | * @param string $after |
||
| 104 | * |
||
| 105 | * @return PaginationRequest |
||
| 106 | */ |
||
| 107 | public function setAfter(string $after): PaginationRequest |
||
| 108 | { |
||
| 109 | $this->after = $after; |
||
| 110 | |||
| 111 | return $this; |
||
| 112 | } |
||
| 113 | |||
| 114 | /** |
||
| 115 | * @return string |
||
| 116 | */ |
||
| 117 | 10 | public function getBefore(): ?string |
|
| 118 | { |
||
| 119 | 10 | return $this->before; |
|
| 120 | } |
||
| 121 | |||
| 122 | /** |
||
| 123 | * @param string $before |
||
| 124 | * |
||
| 125 | * @return PaginationRequest |
||
| 126 | */ |
||
| 127 | public function setBefore(string $before): PaginationRequest |
||
| 132 | } |
||
| 133 | } |
||
| 134 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.