protected function getFrontMatter(\SplFileInfo $file)
    {
        $yaml = null;
        $lines = file($file);
        if (true === isset($lines[0]) && '---' === trim($lines[0])) {
            for ($i = 1; $i < count($lines) && '---' !== trim($lines[$i]); $i++) {
                $yaml .= $lines[$i];
            }
        }

        return $yaml;
    }
protected function getFrontMatter(\SplFileInfo $file)
    {
        $yaml = null;
        $lines = file($file);
        if (true === isset($lines[0]) && '---' === trim($lines[0])) {
            for ($i = 1; $i < count($lines) && '---' !== trim($lines[$i]); $i++) {
                $yaml .= $lines[$i];
            }
        }

        return $yaml;
    }
protected function getFrontMatter ( \ SplFileInfo $ file ) { $ yaml = null ; $ lines = file ( $ file ) ; if ( true === isset ( $ lines [ 0 ] ) && '---' === trim ( $ lines [ 0 ] ) ) { for ( $ i = 1 ; $ i < count ( $ lines ) && '---' !== trim ( $ lines [ $ i ] ) ; $ i ++ ) { $ yaml .= $ lines [ $ i ] ; } } return $ yaml ; }
Returns the front matter from the given file.

@param \SplFileInfo $file File

@return string YAML containing the front matter of the file.
Returns the front matter from the given file .