Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3.2621 |
Changes | 0 |
1 | <?php |
||
38 | 3 | private function assertValidDivisor(int $numerator, int $divisor) |
|
39 | { |
||
40 | 3 | if ($divisor <= 0) { |
|
41 | throw new InvalidArgumentException( |
||
42 | sprintf( |
||
43 | 'Expected a positive $divisor, but instead got: %d', |
||
44 | $divisor |
||
45 | ) |
||
46 | ); |
||
47 | } |
||
48 | |||
49 | 3 | if ($divisor < $numerator) { |
|
50 | 1 | throw new InvalidArgumentException( |
|
51 | 1 | sprintf( |
|
52 | 1 | 'Expected a $divisor that is equal or greater than the $numerator, but instead got: %d < %d', |
|
53 | 1 | $divisor, |
|
54 | 1 | $numerator |
|
55 | ) |
||
56 | ); |
||
57 | } |
||
58 | 3 | } |
|
59 | |||
70 |