This method seems to be duplicated in your project.
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.
Loading history...
24
{
25
16
self::float($value, $message);
26
if ($value < -90 || $value > 90) {
27
throw new InvalidArgument(sprintf($message ?: 'Latitude should be between -90 and 90. Got: %s', $value));
This method seems to be duplicated in your project.
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.
Loading history...
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
43
/**
44
16
* @param mixed $value
45
* @param string $message
46
*/
47
public static function notNull($value, string $message = '')
48
{
49
if (null === $value) {
50
16
throw new InvalidArgument(sprintf($message ?: 'Value cannot be null'));
51
}
52
}
53
54
private static function typeToString($value): string
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.