src/ValueObject/Size.php
public static function fromArray(array $array, $unit = 'px')
    {
        // Requirements for given array:
        // - indexes "0" and "1"
        // - should contains exactly 2 elements
        if (
            array_key_exists(0, $array)
            && array_key_exists(1, $array)
            && 2 === count($array)
        ) {
            list($width, $height) = $array;

            return new self($width, $height, $unit);
        }

        return null;
    }
public static function fromArray(array $array, $unit = 'px')
    {
        // Requirements for given array:
        // - indexes "0" and "1"
        // - should contains exactly 2 elements
        if (
            array_key_exists(0, $array)
            && array_key_exists(1, $array)
            && 2 === count($array)
        ) {
            list($width, $height) = $array;

            return new self($width, $height, $unit);
        }

        return null;
    }
public static function fromArray ( array $ array , $ unit = 'px' ) { // Requirements for given array: // - indexes "0" and "1" // - should contains exactly 2 elements if ( array_key_exists ( 0 , $ array ) && array_key_exists ( 1 , $ array ) && 2 === count ( $ array ) ) { list ( $ width , $ height ) = $ array ; return new self ( $ width , $ height , $ unit ) ; } return null ; }
Creates new instance from given array

The array should contain 2 elements: width and height.
Examples: ['800', '600'], [800, 600].

@param array  $array The size represented as array
@param string $unit  (optional) Unit used when width or height should be returned with unit. Default: "px".
@return null|Size
Creates new instance from given array