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

@param array $input
@return self
@throws InvalidArgumentException
Creates a Circle from a given array