| 1 | <?php |
||
| 17 | class ContentHeadersRenderer |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | private $body; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var array |
||
| 26 | */ |
||
| 27 | private $links = []; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var string |
||
| 31 | */ |
||
| 32 | private $content = ''; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @var array |
||
| 36 | */ |
||
| 37 | private $tags = [ |
||
| 38 | 'h6' => 'h6', |
||
| 39 | 'h5' => 'h6', |
||
| 40 | 'h4' => 'h5', |
||
| 41 | 'h3' => 'h4', |
||
| 42 | 'h2' => 'h3', |
||
| 43 | 'h1' => 'h2', |
||
| 44 | ]; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * HeadersPrerender constructor. |
||
| 48 | * |
||
| 49 | * @param string $body |
||
| 50 | */ |
||
| 51 | public function __construct(string $body) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @return ContentHeadersRenderer |
||
| 58 | */ |
||
| 59 | public function parse(): ContentHeadersRenderer |
||
| 84 | |||
| 85 | /** |
||
| 86 | * @return array |
||
| 87 | */ |
||
| 88 | public function getLinks(): array |
||
| 92 | |||
| 93 | /** |
||
| 94 | * @return string |
||
| 95 | */ |
||
| 96 | public function getContent(): string |
||
| 100 | } |
||
| 101 |
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.