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 | * Content Widget |
||
5 | * |
||
6 | * @package silverstripe-content-widget |
||
7 | */ |
||
8 | class ContentWidget extends Widget |
||
0 ignored issues
–
show
|
|||
9 | { |
||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | public static $db = array( |
||
14 | "HTML" => "HTMLText" |
||
15 | ); |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private static $title = "HTML Content"; |
||
0 ignored issues
–
show
|
|||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private static $cmsTitle = "HTML Content"; |
||
0 ignored issues
–
show
|
|||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | private static $description = "Custom HTML content widget."; |
||
0 ignored issues
–
show
|
|||
31 | |||
32 | /** |
||
33 | * @return FieldList |
||
34 | */ |
||
35 | public function getCMSFields() |
||
36 | { |
||
37 | $fields = parent::getCMSFields(); |
||
38 | |||
39 | $fields->push(TextField::create("Title")); |
||
40 | $fields->push(HtmlEditorField::create("HTML", "Content")); |
||
41 | |||
42 | return $fields; |
||
43 | } |
||
44 | } |
||
45 |
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.