1 | <?php |
||
15 | class Tree |
||
16 | { |
||
17 | /** |
||
18 | * List of Item instances children of this tree. |
||
19 | * |
||
20 | * @var Item[] |
||
21 | */ |
||
22 | protected $items; |
||
23 | |||
24 | /** |
||
25 | * Initializes the instance. |
||
26 | */ |
||
27 | 1 | public function __construct() |
|
31 | |||
32 | /** |
||
33 | * Get the items contained in this tree. |
||
34 | * |
||
35 | * @return Item[] |
||
36 | */ |
||
37 | 1 | public function getItems() |
|
41 | |||
42 | /** |
||
43 | * Resolve the items contained in other CHM files. |
||
44 | * |
||
45 | * @param Map $map |
||
46 | * |
||
47 | * @throws Exception Throw an Exception in case of errors. |
||
48 | */ |
||
49 | 1 | public function resolve(Map $map) |
|
58 | |||
59 | /** |
||
60 | * Create a new instance starting from the whole TOC/Index source 'HTML'. |
||
61 | * |
||
62 | * @param CHM $chm The parent CHM instance. |
||
63 | * @param string $data The contents of the .hhc/.hhk file. |
||
64 | * |
||
65 | * @throws Exception Throw an Exception in case of errors. |
||
66 | * |
||
67 | * @return static |
||
68 | */ |
||
69 | 1 | public static function fromString(CHM $chm, $data) |
|
97 | |||
98 | /** |
||
99 | * Depth of the found child items. |
||
100 | * |
||
101 | * @var int |
||
102 | */ |
||
103 | protected $depth; |
||
104 | |||
105 | /** |
||
106 | * Parse a DOMElement and read the items/sub trees. |
||
107 | * |
||
108 | * @param CHM $chm |
||
109 | * @param DOMElement $parentElement |
||
110 | * @param int $depth |
||
111 | */ |
||
112 | 1 | protected function parseParentElement(CHM $chm, DOMElement $parentElement, $depth) |
|
139 | } |
||
140 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.