public static function createFromArray(array $input)
    {
        if (2 != count($input)) {
            throw new InvalidArgumentException(
                sprintf("%s() expects an array with exactly two elements", __METHOD__)
            );
        }
        if (array_key_exists('start', $input) && array_key_exists('end', $input)) {
            $start = $input['start'];
            $end   = $input['end'];
        } else {
            $start = array_shift($input);
            $end   = array_shift($input);
        }
        if (is_array($start)) {
            $start = Point::createFromArray($start);
        }
        if (is_array($end)) {
            $end = Point::createFromArray($end);
        }
        return new static($start, $end);
    }
public static function createFromArray(array $input)
    {
        if (2 != count($input)) {
            throw new InvalidArgumentException(
                sprintf("%s() expects an array with exactly two elements", __METHOD__)
            );
        }
        if (array_key_exists('start', $input) && array_key_exists('end', $input)) {
            $start = $input['start'];
            $end   = $input['end'];
        } else {
            $start = array_shift($input);
            $end   = array_shift($input);
        }
        if (is_array($start)) {
            $start = Point::createFromArray($start);
        }
        if (is_array($end)) {
            $end = Point::createFromArray($end);
        }
        return new static($start, $end);
    }
public static function createFromArray ( array $ input ) { if ( 2 != count ( $ input ) ) { throw new InvalidArgumentException ( sprintf ( "%s() expects an array with exactly two elements" , __METHOD__ ) ) ; } if ( array_key_exists ( 'start' , $ input ) && array_key_exists ( 'end' , $ input ) ) { $ start = $ input [ 'start' ] ; $ end = $ input [ 'end' ] ; } else { $ start = array_shift ( $ input ) ; $ end = array_shift ( $ input ) ; } if ( is_array ( $ start ) ) { $ start = Point :: createFromArray ( $ start ) ; } if ( is_array ( $ end ) ) { $ end = Point :: createFromArray ( $ end ) ; } return new static ( $ start , $ end ) ; }
Creates an instance of PointPair from a given array

@param array $input
@return self
@throws InvalidArgumentException
Creates an instance of PointPair from a given array