SensioLabs\Deptrac\Configuration\ConfigurationLayer::fromArray PHP Метод

fromArray() публичный статический Метод

public static fromArray ( array $arr )
$arr array
    public static function fromArray(array $arr)
    {
        $options = (new OptionsResolver())->setRequired(['name', 'collectors'])->resolve($arr);
        return new static(array_map(function ($v) {
            return ConfigurationCollector::fromArray($v);
        }, $options['collectors']), $options['name']);
    }

Usage Example

Пример #1
0
 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']);
 }
All Usage Examples Of SensioLabs\Deptrac\Configuration\ConfigurationLayer::fromArray