From 558812696752aa2a7e5050c856a76f7caf52e16c Mon Sep 17 00:00:00 2001 From: Awilum Date: Sun, 17 Feb 2019 23:32:31 +0300 Subject: [PATCH] Flextype Core: Frontmatter Parser - removed. --- flextype/parsers/FrontmatterParser.php | 37 -------------------------- 1 file changed, 37 deletions(-) delete mode 100644 flextype/parsers/FrontmatterParser.php diff --git a/flextype/parsers/FrontmatterParser.php b/flextype/parsers/FrontmatterParser.php deleted file mode 100644 index 78aa090d..00000000 --- a/flextype/parsers/FrontmatterParser.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @link http://flextype.org - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Flextype; - -class FrontmatterParser { - - /** - * Get [matter] and [body] from a content. - * PHP implementation of Jekyll Front Matter. - * - * $content = Entries::frontMatterParser($content); - * - * @param string $content Content to parse - * @access public - * @return array - */ - public static function parse(string $content) : array - { - $parts = preg_split('/^[\s\r\n]?---[\s\r\n]?$/sm', PHP_EOL . ltrim($content)); - - if (count($parts) < 3) { - return ['matter' => [], 'body' => $content]; - } - - return ['matter' => trim($parts[1]), 'body' => implode(PHP_EOL . '---' . PHP_EOL, array_slice($parts, 2))]; - } -}