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