Core/src/GeoPoint.php
private function validateValue($value, $type, $allowNull = false)
    {
        if (!is_numeric($value) && (!$allowNull || ($allowNull && $value !== null))) {
            throw new InvalidArgumentException(sprintf(
                'Given %s must be a numeric value.',
                $type
            ));
        }

        return $allowNull && $value === null
            ? $value
            : (float) $value;
    }
private function validateValue($value, $type, $allowNull = false)
    {
        if (!is_numeric($value) && (!$allowNull || ($allowNull && $value !== null))) {
            throw new InvalidArgumentException(sprintf(
                'Given %s must be a numeric value.',
                $type
            ));
        }

        return $allowNull && $value === null
            ? $value
            : (float) $value;
    }
private function validateValue ( $ value , $ type , $ allowNull = false ) { if ( ! is_numeric ( $ value ) && ( ! $ allowNull || ( $ allowNull && $ value !== null ) ) ) { throw new InvalidArgumentException ( sprintf ( 'Given %s must be a numeric value.' , $ type ) ) ; } return $ allowNull && $ value === null ? $ value : ( float ) $ value ; }
Check a given value's validity as a coordinate.

Numeric values will be cast to type `float`. All other values will raise
an exception with the exception of `null`, if `$allowNull` is set to true.

@param mixed $value The coordinate value.
@param string $type The coordinate type for error reporting.
@param bool $allowNull [optional] Whether null values should be allowed.
**Defaults to** `false`.
@return float|null
Check a given value s validity as a coordinate .