1 | <?php |
||
23 | class ModelObjNodeTreeDTO |
||
24 | { |
||
25 | const INDEX_PATH = 'ip'; |
||
26 | const ROOTS = 'rts'; |
||
27 | const MODEL = 'm'; |
||
28 | const ITEMS = 'i'; |
||
29 | const ID = 'id'; |
||
30 | const RELATIONSHIPS = 'r'; |
||
31 | const COUNT = 'c'; |
||
32 | /** |
||
33 | * @var array with a special structure. Like the following: |
||
34 | * { |
||
35 | * "index_path": [0,3,1,2], |
||
36 | * "roots": [ |
||
37 | * { |
||
38 | * "model": "Event", |
||
39 | * "items": [ |
||
40 | * { |
||
41 | * "id": 123, |
||
42 | * "rels": [ |
||
43 | * { |
||
44 | * "model": "Datetime" |
||
45 | * "count": 3 |
||
46 | * "items": [ |
||
47 | * { |
||
48 | * "id": 456, |
||
49 | * "rels": [ |
||
50 | * { |
||
51 | * "model": "Datetime_Ticket", |
||
52 | * "count": 1, |
||
53 | * "items": [ |
||
54 | * { |
||
55 | * "id": 789, |
||
56 | * "rels": [ |
||
57 | * { |
||
58 | * "model": "Extra_Meta", |
||
59 | * "count": 0, |
||
60 | * "items":[], |
||
61 | * } |
||
62 | * // ... other models that have foreign keys to Datetime_Ticket |
||
63 | * ] |
||
64 | * }. |
||
65 | * ] |
||
66 | * }, |
||
67 | * // ... other models that have foreign keys to Datetime |
||
68 | * ] |
||
69 | * }, |
||
70 | * // ... 2 more datetimes (unless we haven't fetched them from the DB yet. The count |
||
71 | * // is useful here to know if we need to fetch more or not |
||
72 | * ] |
||
73 | * }, |
||
74 | * // ...other models that have foreign keys to events, including implicit join models |
||
75 | * ] |
||
76 | * }, |
||
77 | * // ...other root events that we want to traverse |
||
78 | * ], |
||
79 | * /// ...other models with root nodes |
||
80 | * } |
||
81 | */ |
||
82 | protected $data; |
||
83 | |||
84 | /** |
||
85 | * @since $VID:$ |
||
86 | * @param EE_Base_Class[] $model_objs |
||
87 | */ |
||
88 | public function initializeRootNodes($model_objs){ |
||
106 | |||
107 | /** |
||
108 | * @since $VID:$ |
||
109 | * @param array $data |
||
110 | */ |
||
111 | public function loadData(&$data) |
||
115 | |||
116 | /** |
||
117 | * Returns a reference to the data (so it's not duplicated, because it could be really big). |
||
118 | * @since $VID:$ |
||
119 | * @return array |
||
120 | */ |
||
121 | public function &getData() |
||
125 | |||
126 | /** |
||
127 | * @since $VID:$ |
||
128 | * @param EE_Base_Class $model_obj |
||
129 | */ |
||
130 | public function addDiscoveredItem($model_obj){ |
||
139 | |||
140 | /** |
||
141 | * Returns a list of indexes to follow. |
||
142 | * @since $VID:$ |
||
143 | * @return array |
||
144 | */ |
||
145 | protected function getIndexPath() |
||
149 | |||
150 | /** |
||
151 | * @since $VID:$ |
||
152 | */ |
||
153 | public function getCurrentItemList() |
||
170 | } |
||
171 | // End of file ModelObjNodeTreeDTO.php |
||
173 |
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.