| Total Complexity | 6 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class Markdown implements Arrayable |
||
| 14 | { |
||
| 15 | public string $body; |
||
| 16 | |||
| 17 | public function __construct(string $body = '') |
||
| 18 | { |
||
| 19 | $this->body = $body; |
||
| 20 | } |
||
| 21 | |||
| 22 | public static function fromFile(string $localFilepath): static |
||
| 23 | { |
||
| 24 | return MarkdownDocument::parseFile($localFilepath)->markdown(); |
||
|
|
|||
| 25 | } |
||
| 26 | |||
| 27 | public function render(): string |
||
| 28 | { |
||
| 29 | return MarkdownFacade::render($this->body); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function __toString(): string |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Return the Markdown document body explored by line into an array. |
||
| 39 | * |
||
| 40 | * @return string[] |
||
| 41 | */ |
||
| 42 | public function toArray(): array |
||
| 43 | { |
||
| 44 | return explode("\n", $this->body); |
||
| 45 | } |
||
| 46 | |||
| 47 | public function body(): string |
||
| 50 | } |
||
| 51 | } |
||
| 52 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.