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
15
if (!is_float($value)) {
26
throw new InvalidArgument(
27
sprintf($message ?: 'Expected a double. Got: %s', self::typeToString($value))
28
);
29
}
30
31
15
if ($value < -90 || $value > 90) {
32
throw new InvalidArgument(
33
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...
43
{
44
15
if (!is_float($value)) {
45
throw new InvalidArgument(
46
sprintf($message ?: 'Expected a doable. Got: %s', self::typeToString($value))
47
);
48
}
49
50
15
if ($value < -180 || $value > 180) {
51
throw new InvalidArgument(
52
sprintf($message ?: 'Latitude should be between -90 and 90. Got: %s', $value)
53
);
54
}
55
15
}
56
57
/**
58
* @param mixed $value
59
* @param string $message
60
*/
61
15
public static function notNull($value, $message = '')
62
{
63
15
if (null === $value) {
64
throw new InvalidArgument(sprintf($message ?: 'Value cannot be null'));
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.