1 | <?php |
||
10 | class DataObjectSorterDOD extends DataExtension |
||
11 | { |
||
12 | |||
13 | |||
14 | /** |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | private static $sort_field = "Sort"; |
||
19 | |||
20 | /** |
||
21 | * standard SS variable |
||
22 | * |
||
23 | */ |
||
24 | private static $db = array( |
||
25 | 'Sort' => 'Int' |
||
26 | ); |
||
27 | |||
28 | /** |
||
29 | * standard SS variable |
||
30 | * |
||
31 | */ |
||
32 | private static $casting = array( |
||
33 | 'SortTitle' => 'Varchar' |
||
34 | ); |
||
35 | |||
36 | /** |
||
37 | * action sort |
||
38 | * @param array $data |
||
39 | * @return string |
||
40 | */ |
||
41 | public function dodataobjectsort($data) |
||
80 | |||
81 | /** |
||
82 | * |
||
83 | * standard SS method |
||
84 | * @param FieldList $fields |
||
85 | * @return FieldList |
||
86 | */ |
||
87 | public function updateCMSFields(FieldList $fields) |
||
96 | |||
97 | /** |
||
98 | * simplified method |
||
99 | * |
||
100 | * @param string $filterField |
||
101 | * @param string $filterValue |
||
102 | * @param string $alternativeTitle |
||
103 | * |
||
104 | * @return string HTML |
||
105 | **/ |
||
106 | public function dataObjectSorterPopupLink($filterField = '', $filterValue = '', $alternativeTitle = '') |
||
116 | |||
117 | /** |
||
118 | * returns field name for sorting |
||
119 | * |
||
120 | * @return string |
||
121 | **/ |
||
122 | public function SortFieldForDataObjectSorter() |
||
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.