Esempio n. 1
0
 /**
  * Create an instance from array.
  *
  * Merge the candidate config with the defaults.
  *
  * @param array $config
  * @param array $default
  * @return Config
  */
 public static function fromArray($config, array $defaults = [])
 {
     Ensure::isArray($config, 'The root element in the config must be an object');
     return new static(array_replace($defaults, $config));
 }