PSR1 classes have a namespace declaration.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | |||
4 | class CMSPageAddController_Products extends CMSPageAddController |
||
0 ignored issues
–
show
|
|||
5 | { |
||
6 | private static $url_segment = 'addproductorproductgroup'; |
||
7 | |||
8 | private static $url_rule = '/$Action/$ID/$OtherID'; |
||
9 | |||
10 | private static $url_priority = 41; |
||
11 | |||
12 | private static $menu_title = 'Add Product'; |
||
13 | |||
14 | private static $required_permission_codes = 'CMS_ACCESS_CMSMain'; |
||
15 | |||
16 | private static $allowed_actions = array( |
||
17 | 'AddForm', |
||
18 | 'doAdd', |
||
19 | 'doCancel', |
||
20 | ); |
||
21 | |||
22 | |||
23 | /** |
||
24 | * the class of the page that is the root parent for the shop. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | private static $root_parent_class_for_adding_page = 'ProductGroupSearchPage'; |
||
29 | |||
30 | |||
31 | public function doCancel($data, $form) |
||
32 | { |
||
33 | return $this->redirect(singleton('ProductsAndGroupsModelAdmin')->Link()); |
||
34 | } |
||
35 | |||
36 | |||
37 | /** |
||
38 | * @return ArrayList |
||
39 | */ |
||
40 | public function PageTypes() |
||
41 | { |
||
42 | $pageTypes = parent::PageTypes(); |
||
43 | $result = new ArrayList(); |
||
44 | $productClass = Object::getCustomClass('Product'); |
||
45 | $productGroupClass = Object::getCustomClass('ProductGroup'); |
||
46 | |||
47 | $acceptedClasses1 = ClassInfo::subclassesFor($productClass); |
||
48 | $acceptedClasses1[$productClass] = $productClass; |
||
49 | |||
50 | $acceptedClasses2 = ClassInfo::subclassesFor($productGroupClass); |
||
51 | $acceptedClasses2[$productGroupClass] = $productGroupClass; |
||
52 | |||
53 | $acceptedClasses = array_merge($acceptedClasses1, $acceptedClasses2); |
||
54 | foreach ($pageTypes as $type) { |
||
55 | if (in_array($type->ClassName, $acceptedClasses)) { |
||
56 | $result->push($type); |
||
57 | } |
||
58 | } |
||
59 | |||
60 | return $result; |
||
61 | } |
||
62 | } |
||
63 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.