src/Guzzle/Common/Collection.php
public static function fromConfig(array $config = array(), array $defaults = array(), array $required = array())
    {
        $data = $config + $defaults;

        if ($missing = array_diff($required, array_keys($data))) {
            throw new InvalidArgumentException('Config is missing the following keys: ' . implode(', ', $missing));
        }

        return new self($data);
    }
public static function fromConfig(array $config = array(), array $defaults = array(), array $required = array())
    {
        $data = $config + $defaults;

        if ($missing = array_diff($required, array_keys($data))) {
            throw new InvalidArgumentException('Config is missing the following keys: ' . implode(', ', $missing));
        }

        return new self($data);
    }
public static function fromConfig ( array $ config = array ( ) , array $ defaults = array ( ) , array $ required = array ( ) ) { $ data = $ config + $ defaults ; if ( $ missing = array_diff ( $ required , array_keys ( $ data ) ) ) { throw new InvalidArgumentException ( 'Config is missing the following keys: ' . implode ( ', ' , $ missing ) ) ; } return new self ( $ data ) ; }
Create a new collection from an array, validate the keys, and add default values where missing

@param array $config   Configuration values to apply.
@param array $defaults Default parameters
@param array $required Required parameter names

@return self
@throws InvalidArgumentException if a parameter is missing
Create a new collection from an array validate the keys and add default values where missing