| @@ 104-111 (lines=8) @@ | ||
| 101 | */ |
|
| 102 | public function setPage($page) |
|
| 103 | { |
|
| 104 | if (false === is_numeric($page) || $page < 1 || $page > 10) { |
|
| 105 | throw new \InvalidArgumentException(sprintf('%s is an invalid page value. It has to be numeric, positive and between 1 and 10', |
|
| 106 | $page)); |
|
| 107 | } |
|
| 108 | ||
| 109 | $this->parameter['ItemPage'] = $page; |
|
| 110 | ||
| 111 | return $this; |
|
| 112 | } |
|
| 113 | ||
| 114 | /** |
|
| @@ 250-257 (lines=8) @@ | ||
| 247 | */ |
|
| 248 | protected function validatePrice($price) |
|
| 249 | { |
|
| 250 | if (false === is_numeric($price) || $price < 1) { |
|
| 251 | throw new \InvalidArgumentException(sprintf('%s is an invalid price value. It has to be numeric and >= than 1', |
|
| 252 | $price)); |
|
| 253 | } |
|
| 254 | } |
|
| 255 | } |
|
| 256 | ||