SensioLabs\Deptrac\Configuration::fromArray PHP Méthode

fromArray() public static méthode

public static fromArray ( array $arr )
$arr array
    public static function fromArray(array $arr)
    {
        $options = (new OptionsResolver())->setRequired(['layers', 'paths', 'exclude_files', 'ruleset'])->addAllowedTypes('layers', 'array')->addAllowedTypes('paths', 'array')->addAllowedTypes('exclude_files', ['array', 'null'])->addAllowedTypes('ruleset', 'array')->resolve($arr);
        return new static(array_map(function ($v) {
            return ConfigurationLayer::fromArray($v);
        }, $options['layers']), ConfigurationRuleset::fromArray($options['ruleset']), $options['paths'], (array) $options['exclude_files']);
    }

Usage Example

 /** @return Configuration */
 public function loadConfiguration()
 {
     return Configuration::fromArray(Yaml::parse(file_get_contents($this->configFilePathname)));
 }
All Usage Examples Of SensioLabs\Deptrac\Configuration::fromArray