Test Failed
Pull Request — master (#4)
by Simon
10:36
created

MatomoMemberExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 9 1
1
<?php
2
3
namespace ElliotSawyer\Matomo;
4
5
use SilverStripe\Forms\CheckboxField;
6
use SilverStripe\ORM\DataExtension;
7
8
/**
9
 * Class \ElliotSawyer\Matomo\MatomoMemberExtension
10
 *
11
 * @property Member|MatomoMemberExtension $owner
12
 * @property boolean $DisableMatomo
13
 */
14
class MatomoMemberExtension extends DataExtension
15
{
16
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
17
        'DisableMatomo' => 'Boolean'
18
    ];
19
20
    public function updateCMSFields(\SilverStripe\Forms\FieldList $fields)
21
    {
22
        $fields->insertAfter(
23
            'Groups',
24
            CheckboxField::create(
25
                'DisableMatomo',
26
                'Disable Matomo Analytics tracking'
27
            )->setDescription(
28
                'Allow the member to opt-out of Matomo Analytics tracking'
29
            )
30
        );
31
    }
32
}
33