| Total Complexity | 6 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | class MarkdownDocument implements MarkdownDocumentContract, Stringable |
||
| 20 | { |
||
| 21 | use InteractsWithFrontMatter; |
||
| 22 | |||
| 23 | public FrontMatter $matter; |
||
| 24 | public Markdown $markdown; |
||
| 25 | |||
| 26 | public function __construct(FrontMatter|array $matter = [], Markdown|string $body = '') |
||
| 27 | { |
||
| 28 | $this->matter = $matter instanceof FrontMatter ? $matter : new FrontMatter($matter); |
||
|
|
|||
| 29 | $this->markdown = $body instanceof Markdown ? $body : new Markdown($body); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function __toString(): string |
||
| 33 | { |
||
| 34 | return $this->markdown->__toString(); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function markdown(): Markdown |
||
| 38 | { |
||
| 39 | return $this->markdown; |
||
| 40 | } |
||
| 41 | |||
| 42 | public static function parse(string $localFilepath): static |
||
| 45 | } |
||
| 46 | } |
||
| 47 |