19 declare(strict_types=1);
32 $parser_state = self::PARSER_STATE_OUTSIDE;
35 foreach (preg_split(
"/((\r?\n)|(\r\n?))/", $content) as $line) {
37 if ($parser_state === self::PARSER_STATE_OUTSIDE) {
38 if (preg_match(
'/---/', $line)) {
40 $parser_state = self::PARSER_STATE_ENTRY;
43 } elseif ($parser_state === self::PARSER_STATE_ENTRY) {
44 if (!preg_match(
'/(\*$)|(---)/', $line)) {
47 if (preg_match(
'/---/', $line)) {
48 $parser_state = self::PARSER_STATE_END;
52 if ($parser_state !== self::PARSER_STATE_END) {
57 return array_shift($entry);
getPHPArrayFromYamlArray(array $yaml_entries)
getYamlEntriesFromString(string $content)
purifyYamlLine(string $line)