CopyrightSiteConfigExtras   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 14 1
1
<?php
2
3
/**
4
 *@author nicolaas [at] sunnysideup.co.nz
5
 *
6
 *
7
 **/
8
9
class CopyrightSiteConfigExtras extends DataExtension
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...
10
{
11
    private static $db = [
0 ignored issues
show
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...
12
        'CopyrightNotice' => 'HTMLVarchar'
13
    ];
14
15
    public function updateCMSFields(FieldList $fields)
16
    {
17
        $tabTitle = _t('CopyrightSiteConfigExtras.PAGE_ELEMENTS', 'Page Elements');
18
        $fields->addFieldToTab(
19
            'Root.'.$tabTitle,
20
            $editor = HTMLEditorField::create(
21
                'CopyrightNotice',
22
                _t('CopyrightSiteConfigExtras.COPYRIGHT', 'COPYRIGHT')
23
            )
24
        );
25
        $editor->setRows(4);
26
27
        return $fields;
28
    }
29
}
30