src/ConfigCollectionFactory.php
public static function makeFromFiles(string ...$paths): ConfigCollection
    {
        $definitions = array_map(function (string $path): array {
            try {
                // Toml::parseFile might return void / null.
                $definitions = (array) Toml::parseFile($path);

                // See: Automattic/VIP-Coding-Standards#144 on Github.
                // phpcs:ignore WordPressVIPMinimum.Variables.VariableAnalysis.UnusedVariable
            } catch (ParseException $_parseException) {
                // Assume empty config.
                $definitions = [];
            }

            return $definitions;
        }, $paths);

        $mergedDefinitions = array_reduce($definitions, function (array $merged, array $definition): array {
            return self::arrayMergeRecursiveDistinct($merged, $definition);
        }, []);

        return new ConfigCollection($mergedDefinitions);
    }
public static function makeFromFiles(string ...$paths): ConfigCollection
    {
        $definitions = array_map(function (string $path): array {
            try {
                // Toml::parseFile might return void / null.
                $definitions = (array) Toml::parseFile($path);

                // See: Automattic/VIP-Coding-Standards#144 on Github.
                // phpcs:ignore WordPressVIPMinimum.Variables.VariableAnalysis.UnusedVariable
            } catch (ParseException $_parseException) {
                // Assume empty config.
                $definitions = [];
            }

            return $definitions;
        }, $paths);

        $mergedDefinitions = array_reduce($definitions, function (array $merged, array $definition): array {
            return self::arrayMergeRecursiveDistinct($merged, $definition);
        }, []);

        return new ConfigCollection($mergedDefinitions);
    }
public static function makeFromFiles ( string ... $ paths ) : ConfigCollection { $ definitions = array_map ( function ( string $ path ) : array { try { // Toml::parseFile might return void / null. $ definitions = ( array ) Toml :: parseFile ( $ path ) ; // See: Automattic/VIP-Coding-Standards#144 on Github. // phpcs:ignore WordPressVIPMinimum.Variables.VariableAnalysis.UnusedVariable } catch ( ParseException $ _parseException ) { // Assume empty config. $ definitions = [ ] ; } return $ definitions ; } , $ paths ) ; $ mergedDefinitions = array_reduce ( $ definitions , function ( array $ merged , array $ definition ) : array { return self :: arrayMergeRecursiveDistinct ( $ merged , $ definition ) ; } , [ ] ) ; return new ConfigCollection ( $ mergedDefinitions ) ; }
Parses the TOML and returns a config instance.

@param string|string[] ...$paths Paths to TOML files.

@return ConfigCollection
Parses the TOML and returns a config instance .