1 | <?php |
||
11 | class GoogleMapLocationsDOD extends SiteTreeExtension |
||
12 | { |
||
13 | private static $db = array( |
||
14 | "HasGeoInfo" => "Boolean" |
||
15 | ); |
||
16 | |||
17 | private static $has_many = array( |
||
18 | "GeoPoints" => "GoogleMapLocationsObject" |
||
19 | ); |
||
20 | |||
21 | /** |
||
22 | * list of pages types without a map |
||
23 | * @var Array |
||
24 | */ |
||
25 | private static $page_classes_without_map = array(); |
||
26 | |||
27 | /** |
||
28 | * list of pages types with a map |
||
29 | * @var Array |
||
30 | */ |
||
31 | private static $page_classes_with_map = array(); |
||
32 | |||
33 | /** |
||
34 | * @param FieldList |
||
35 | */ |
||
36 | public function updateCMSFields(FieldList $fields) |
||
66 | |||
67 | /** |
||
68 | * returns the HTML for a info window on a map for this page. |
||
69 | * @return String (HTML) |
||
70 | */ |
||
71 | public function AjaxInfoWindowLink() |
||
84 | |||
85 | /** |
||
86 | * Page Type has a Google Map |
||
87 | * @return Boolean |
||
88 | */ |
||
89 | public function ClassHasGoogleMap() |
||
108 | |||
109 | /** |
||
110 | * Recursively search children of current page to find a particular classtype |
||
111 | * |
||
112 | * @param $parentPage DataObject The Object of which you want to find the children |
||
113 | * @param $classType String The text string to match `ClassName` field |
||
114 | * |
||
115 | * @return ArrayList of items if Class $classType |
||
116 | */ |
||
117 | public function getChildrenOfType($parentPage, $classType = null) |
||
135 | } |
||
136 |
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.