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