| Total Complexity | 8 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class FrontMatter implements Arrayable, \Stringable |
||
| 15 | { |
||
| 16 | public array $matter; |
||
| 17 | |||
| 18 | public function __construct(array $matter = []) |
||
| 19 | { |
||
| 20 | $this->matter = $matter; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function __toString(): string |
||
| 24 | { |
||
| 25 | return (new ConvertsArrayToFrontMatter())->execute($this->matter); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function __get(string $key): mixed |
||
| 29 | { |
||
| 30 | return $this->get($key); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function get(string $key = null, mixed $default = null): mixed |
||
| 40 | } |
||
| 41 | |||
| 42 | public function set(string $key, mixed $value): static |
||
| 43 | { |
||
| 44 | $this->matter[$key] = $value; |
||
| 45 | |||
| 46 | return $this; |
||
| 47 | } |
||
| 48 | |||
| 49 | public function toArray(): array |
||
| 52 | } |
||
| 53 | |||
| 54 | public static function fromArray(array $matter): static |
||
| 57 | } |
||
| 58 | } |
||
| 59 |