Conditions | 4 |
Paths | 2 |
Total Lines | 7 |
Code Lines | 4 |
Lines | 7 |
Ratio | 100 % |
Tests | 1 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
35 | View Code Duplication | public static function longitude($value, string $message = '') |
|
36 | 16 | { |
|
37 | self::float($value, $message); |
||
38 | if ($value < -180 || $value > 180) { |
||
39 | throw new InvalidArgument(sprintf($message ?: 'Longitude should be between -180 and 180. Got: %s', $value)); |
||
40 | } |
||
41 | } |
||
42 | 16 | ||
72 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.