Conditions | 5 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 5.0488 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | 5 | private function setLatitudeIsValid($latitude): void |
|
41 | { |
||
42 | 5 | $isValid = true; |
|
43 | |||
44 | 5 | if (!is_numeric($latitude)) { |
|
45 | $isValid = false; |
||
46 | } |
||
47 | |||
48 | 5 | $latitude = (float)$latitude; |
|
49 | |||
50 | 5 | if (!$isValid || $latitude < -90 || $latitude > 90) { |
|
51 | 2 | throw new InvalidArgumentException('Invalid latitude. It must be a number between -90 and 90'); |
|
52 | } |
||
53 | |||
54 | 3 | $this->latitude = $latitude; |
|
55 | 3 | } |
|
74 |