CrEOF\Spatial\PHP\Types\AbstractGeometry::validatePointValue PHP Method

validatePointValue() protected method

protected validatePointValue ( CrEOF\Spatial\PHP\Types\AbstractPoint | array $point ) : array
$point CrEOF\Spatial\PHP\Types\AbstractPoint | array
return array
    protected function validatePointValue($point)
    {
        switch (true) {
            case $point instanceof AbstractPoint:
                return $point->toArray();
                break;
            case is_array($point) && count($point) == 2 && is_numeric($point[0]) && is_numeric($point[1]):
                return array_values($point);
                break;
            default:
                throw new InvalidValueException(sprintf('Invalid %s Point value of type "%s"', $this->getType(), is_object($point) ? get_class($point) : gettype($point)));
        }
    }