| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function parse(string $body): ProcessedBody |
||
| 24 | { |
||
| 25 | $links = []; |
||
| 26 | |||
| 27 | $body = preg_replace_callback('/<(h\d+)>(.*?)<\/h\d+>/isu', function ($data) use (&$links) { |
||
| 28 | list($data, $tag, $header) = $data; |
||
|
|
|||
| 29 | |||
| 30 | $id = $this->createAnchorName($header); |
||
| 31 | |||
| 32 | $links[] = new AnchorLink($id, $header, $tag); |
||
| 33 | |||
| 34 | return $this->render($tag, $id, $header); |
||
| 35 | }, $body); |
||
| 36 | |||
| 37 | return new ProcessedBody($body, $links); |
||
| 38 | } |
||
| 39 | |||
| 62 |
This checks looks for assignemnts to variables using the
list(...)function, where not all assigned variables are subsequently used.Consider the following code example.
Only the variables
$aand$care used. There was no need to assign$b.Instead, the list call could have been.