| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | 30 | public function setDerivationIterations($numberOfIterations) |
|
| 33 | { |
||
| 34 | 30 | $numberOfIterations = filter_var( |
|
| 35 | 30 | $numberOfIterations, |
|
| 36 | 30 | FILTER_VALIDATE_INT, |
|
| 37 | 30 | [ |
|
| 38 | 30 | "options" => [ |
|
| 39 | 30 | "min_range" => 1, |
|
| 40 | 30 | "max_range" => PHP_INT_MAX, |
|
| 41 | 30 | ], |
|
| 42 | 30 | ] |
|
| 43 | 30 | ); |
|
| 44 | |||
| 45 | 30 | if ($numberOfIterations === false) { |
|
| 46 | 15 | throw new \InvalidArgumentException( |
|
| 47 | 15 | 'The number of internal iterations must be a valid integer bigger than 0.' |
|
| 48 | 15 | ); |
|
| 49 | } |
||
| 50 | |||
| 51 | 15 | $this->numberOfIterations = $numberOfIterations; |
|
| 52 | |||
| 53 | 15 | return $this; |
|
| 54 | } |
||
| 66 |