PoptinSiteConfig   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 3
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 7 1
1
<?php
2
3
namespace Poptin\Silverstripe;
4
5
use SilverStripe\Forms\FieldList;
6
use SilverStripe\Forms\TextField;
7
use SilverStripe\ORM\DataExtension;
8
9
class PoptinSiteConfig extends DataExtension
10
{
11
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
12
        'PoptinConfig' => 'Text'
13
    ];
14
15
    public function updateCMSFields(FieldList $fields)
16
    {
17
        $fields->addFieldToTab(
18
            "Root.Main",
19
            new TextField("PoptinConfig", "Poptin Config")
20
        );
21
        $fields->removeByName(['PoptinConfig']);
22
    }
23
}
24