private function parse_files($path, $overwrite = true)
    {
        if (\is_dir($path)) {
            $files = \glob($path . '*.php');
        }

        if (!empty($files)) {
            foreach ($files as $file) {
                /** @noinspection PhpIncludeInspection */
                $parsed_options = require $file;

                $option_set = $this->get_filename($file);

                if (!\is_array($parsed_options)) {
                    continue;
                }

                if (isset($this->config[ $option_set ])) {
                    if ($overwrite) {
                        $this->config[ $option_set ] = \array_merge($this->config[ $option_set ], $parsed_options);
                    } else {
                        $this->config[ $option_set ] = \array_merge($parsed_options, $this->config[ $option_set ]);
                    }
                } else {
                    $this->config[ $option_set ] = $parsed_options;
                }
            }
        }
    }
private function parse_files($path, $overwrite = true)
    {
        if (\is_dir($path)) {
            $files = \glob($path . '*.php');
        }

        if (!empty($files)) {
            foreach ($files as $file) {
                /** @noinspection PhpIncludeInspection */
                $parsed_options = require $file;

                $option_set = $this->get_filename($file);

                if (!\is_array($parsed_options)) {
                    continue;
                }

                if (isset($this->config[ $option_set ])) {
                    if ($overwrite) {
                        $this->config[ $option_set ] = \array_merge($this->config[ $option_set ], $parsed_options);
                    } else {
                        $this->config[ $option_set ] = \array_merge($parsed_options, $this->config[ $option_set ]);
                    }
                } else {
                    $this->config[ $option_set ] = $parsed_options;
                }
            }
        }
    }
private function parse_files ( $ path , $ overwrite = true ) { if ( \ is_dir ( $ path ) ) { $ files = \ glob ( $ path . '*.php' ) ; } if ( ! empty ( $ files ) ) { foreach ( $ files as $ file ) { /** @noinspection PhpIncludeInspection */ $ parsed_options = require $ file ; $ option_set = $ this -> get_filename ( $ file ) ; if ( ! \ is_array ( $ parsed_options ) ) { continue ; } if ( isset ( $ this -> config [ $ option_set ] ) ) { if ( $ overwrite ) { $ this -> config [ $ option_set ] = \ array_merge ( $ this -> config [ $ option_set ] , $ parsed_options ) ; } else { $ this -> config [ $ option_set ] = \ array_merge ( $ parsed_options , $ this -> config [ $ option_set ] ) ; } } else { $ this -> config [ $ option_set ] = $ parsed_options ; } } } }
Scans a path for config files, and merges them into the config.

@param string $path      Directory path to scan.
@param bool   $overwrite If true, then the config within the $path will overwrite existing config keys.
Scans a path for config files and merges them into the config .