private function processFile($filePath, $group = null, $baseDir = null)
    {
        if (is_null($baseDir)) {
            $baseDir = $this->baseDirectory;
        }
        if ( ! is_string($baseDir)) {
            $baseDir = '';
        }
        if ($baseDir) {
            $baseDir = rtrim($baseDir, '/').'/';
        }
        $content = $this->findAndParseFile($baseDir.$filePath);
        if (empty($content)) {
            return null;
        }
        if (is_null($group)) {
            $fileNameBase = $this->extractFileNameBase($filePath);
            if ('config' === strtolower($fileNameBase)) {
                $group = false;
            } else {
                $group = $fileNameBase;
            }
        } elseif (true === $group) {
            $fileNameBase = $this->extractFileNameBase($filePath);
            $group = $fileNameBase;
        }
        if ($group) {
            $result = array($group => $content);
        } else {
            $result = $content;
        }
        return $result;
    }
private function processFile($filePath, $group = null, $baseDir = null)
    {
        if (is_null($baseDir)) {
            $baseDir = $this->baseDirectory;
        }
        if ( ! is_string($baseDir)) {
            $baseDir = '';
        }
        if ($baseDir) {
            $baseDir = rtrim($baseDir, '/').'/';
        }
        $content = $this->findAndParseFile($baseDir.$filePath);
        if (empty($content)) {
            return null;
        }
        if (is_null($group)) {
            $fileNameBase = $this->extractFileNameBase($filePath);
            if ('config' === strtolower($fileNameBase)) {
                $group = false;
            } else {
                $group = $fileNameBase;
            }
        } elseif (true === $group) {
            $fileNameBase = $this->extractFileNameBase($filePath);
            $group = $fileNameBase;
        }
        if ($group) {
            $result = array($group => $content);
        } else {
            $result = $content;
        }
        return $result;
    }
private function processFile ( $ filePath , $ group = null , $ baseDir = null ) { if ( is_null ( $ baseDir ) ) { $ baseDir = $ this -> baseDirectory ; } if ( ! is_string ( $ baseDir ) ) { $ baseDir = '' ; } if ( $ baseDir ) { $ baseDir = rtrim ( $ baseDir , '/' ) . '/' ; } $ content = $ this -> findAndParseFile ( $ baseDir . $ filePath ) ; if ( empty ( $ content ) ) { return null ; } if ( is_null ( $ group ) ) { $ fileNameBase = $ this -> extractFileNameBase ( $ filePath ) ; if ( 'config' === strtolower ( $ fileNameBase ) ) { $ group = false ; } else { $ group = $ fileNameBase ; } } elseif ( true === $ group ) { $ fileNameBase = $ this -> extractFileNameBase ( $ filePath ) ; $ group = $ fileNameBase ; } if ( $ group ) { $ result = array ( $ group => $ content ) ; } else { $ result = $ content ; } return $ result ; }
Processing the file, optionally putting result under group

@param string $filePath
@param string|null|bool $group Whether parsed file content should be under some group.
False - no group (root node)
True - Group same as file base name (without extension)
String - under provided string
Null (default) - based on file base name - if it is 'config' then root, otherwise file name
@param string|null $baseDir If provided, then prepended to $filePath, is null, then Application path is prepended
@return array|null
Processing the file optionally putting result under group