private function loadFile(
        array &$items,
        string $path,
        string $pathRelative,
        string $configKey,
        $environment = null
    ): void {
        // Build filename.
        $filename = $path;
        if ($pathRelative !== null && $pathRelative !== '') {
            $filename .= '/' . $pathRelative;
        }
        $filename .= '/' . $configKey;
        if ($environment !== null) {
            $filename .= '.' . (string)$environment;
        }
        $filename .= '.php';

        // Load configuration.
        if (!file_exists($filename)) {
            return;
        }
        $config = require($filename);

        // Parse config.
        $itemsData = &$items;
        if ($pathRelative !== '') {
            $pathSegments = explode('.', $pathRelative);
            foreach ($pathSegments as $pathSegment) {
                $itemsData = &$itemsData[$pathSegment];
            }
        }
        if (!isset($itemsData[$configKey])) {
            $itemsData[$configKey] = null;
        }
        if (is_array($itemsData[$configKey]) && is_array($config)) {
            $itemsData[$configKey] = array_merge($itemsData[$configKey], $config);
        } else {
            $itemsData[$configKey] = $config;
        }
    }
private function loadFile(
        array &$items,
        string $path,
        string $pathRelative,
        string $configKey,
        $environment = null
    ): void {
        // Build filename.
        $filename = $path;
        if ($pathRelative !== null && $pathRelative !== '') {
            $filename .= '/' . $pathRelative;
        }
        $filename .= '/' . $configKey;
        if ($environment !== null) {
            $filename .= '.' . (string)$environment;
        }
        $filename .= '.php';

        // Load configuration.
        if (!file_exists($filename)) {
            return;
        }
        $config = require($filename);

        // Parse config.
        $itemsData = &$items;
        if ($pathRelative !== '') {
            $pathSegments = explode('.', $pathRelative);
            foreach ($pathSegments as $pathSegment) {
                $itemsData = &$itemsData[$pathSegment];
            }
        }
        if (!isset($itemsData[$configKey])) {
            $itemsData[$configKey] = null;
        }
        if (is_array($itemsData[$configKey]) && is_array($config)) {
            $itemsData[$configKey] = array_merge($itemsData[$configKey], $config);
        } else {
            $itemsData[$configKey] = $config;
        }
    }
private function loadFile ( array & $ items , string $ path , string $ pathRelative , string $ configKey , $ environment = null ) : void { // Build filename. $ filename = $ path ; if ( $ pathRelative !== null && $ pathRelative !== '' ) { $ filename .= '/' . $ pathRelative ; } $ filename .= '/' . $ configKey ; if ( $ environment !== null ) { $ filename .= '.' . ( string ) $ environment ; } $ filename .= '.php' ; // Load configuration. if ( ! file_exists ( $ filename ) ) { return ; } $ config = require ( $ filename ) ; // Parse config. $ itemsData = & $ items ; if ( $ pathRelative !== '' ) { $ pathSegments = explode ( '.' , $ pathRelative ) ; foreach ( $ pathSegments as $ pathSegment ) { $ itemsData = & $ itemsData [ $ pathSegment ] ; } } if ( ! isset ( $ itemsData [ $ configKey ] ) ) { $ itemsData [ $ configKey ] = null ; } if ( is_array ( $ itemsData [ $ configKey ] ) && is_array ( $ config ) ) { $ itemsData [ $ configKey ] = array_merge ( $ itemsData [ $ configKey ] , $ config ) ; } else { $ itemsData [ $ configKey ] = $ config ; } }
Load file.

@param mixed[] $items
@param string $path
@param string $pathRelative
@param string $configKey
@param mixed $environment Default null.
Load file .