Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | } |
||
18 | |||
19 | $matter = Yaml::parse(trim($parts[1])); |
||
20 | |||
21 | $body = implode(PHP_EOL . "---" . PHP_EOL, array_slice($parts, 2)); |
||
22 | |||
23 | return new Document($matter, $body); |
||
24 | } |
||
25 | |||
26 | public static function parseFile(string $path): Document |
||
27 | { |
||
28 | return static::parse( |
||
29 | file_get_contents($path) |
||
30 | ); |
||
31 | } |
||
32 | } |
||
33 |