| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function extractData($path) |
||
| 30 | { |
||
| 31 | $lines = static::getModule()->readArray($path); |
||
| 32 | $matterLines = $this->readQuotedLines($lines, '/^{#/', '/#}$/'); |
||
| 33 | if (empty($matterLines)) { |
||
| 34 | $data = []; |
||
| 35 | $text = $lines; |
||
| 36 | } else { |
||
| 37 | $data = $this->readFrontMatter($matterLines); |
||
| 38 | $text = array_slice($lines, count($matterLines)); |
||
| 39 | } |
||
| 40 | |||
| 41 | return [$data, implode("\n", $text)]; |
||
| 42 | } |
||
| 43 | } |
||
| 44 |
If you implement
__calland you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__callis implemented by a parent class and only the child class knows which methods exist: