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 | public function __construct() |
||
31 | |||
32 | /** |
||
33 | * Get the items contained in this tree. |
||
34 | * |
||
35 | * @return Item[] |
||
36 | */ |
||
37 | public function getItems() |
||
41 | |||
42 | /** |
||
43 | * Append to the children of this tree the children of another tree. |
||
44 | * |
||
45 | * @param Tree $tree |
||
46 | */ |
||
47 | public function mergeItems(Tree $tree) |
||
51 | |||
52 | /** |
||
53 | * Resolve the items contained in other CHM files. |
||
54 | * |
||
55 | * @param Map $map |
||
56 | * |
||
57 | * @throws Exception Throw an Exception in case of errors. |
||
58 | */ |
||
59 | public function resolve(Map $map) |
||
73 | |||
74 | /** |
||
75 | * Create a new instance starting from the whole TOC/Index source 'HTML'. |
||
76 | * |
||
77 | * @param CHM $chm The parent CHM instance. |
||
78 | * @param string $data The contents of the .hhc/.hhk file. |
||
79 | * |
||
80 | * @throws Exception Throw an Exception in case of errors. |
||
81 | * |
||
82 | * @return static |
||
83 | */ |
||
84 | public static function fromString(CHM $chm, $data) |
||
112 | |||
113 | /** |
||
114 | * Depth of the found child items. |
||
115 | * |
||
116 | * @var int |
||
117 | */ |
||
118 | protected $depth; |
||
119 | |||
120 | /** |
||
121 | * Parse a DOMElement and read the items/sub trees. |
||
122 | * |
||
123 | * @param CHM $chm |
||
124 | * @param DOMElement $parentElement |
||
125 | * @param int $depth |
||
126 | */ |
||
127 | protected function parseParentElement(CHM $chm, DOMElement $parentElement, $depth) |
||
154 | } |
||
155 |
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.