AccordionItem::getCMSFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
/**
4
 * Class AccordionItem
5
 * 
6
 * There are no permissions, as they're part of Page, and not a separate thing.
7
 *
8
 * @property string $Title
9
 * @property string $Content
10
 * @property int $SortOrder
11
 * @property int $PageID
12
 * @method Page Page()
13
 */
14
class AccordionItem extends DataObject
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
15
{
16
    private static $db = [
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $db is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
17
        'Title'     => 'Varchar(255)',
18
        'Content'   => 'HTMLText',
19
        'SortOrder' => 'Int',
20
    ];
21
22
    private static $has_one = [
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $has_one is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
23
        'Page' => 'Page'
24
    ];
25
26
    public function getCMSFields()
27
    {
28
        $fields = parent::getCMSFields();
29
        $fields->removeByName(['PageID', 'SortOrder']);
30
31
        return $fields;
32
    }
33
34
}