EcommerceMailchimpSignupDecoratorConfigFixes   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 11 1
1
<?php
2
3
4
class EcommerceMailchimpSignupDecoratorConfigFixes 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...
5
{
6
    private static $db = array(
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...
7
        "MailchimpSignupHeader" => "Varchar(50)",
8
        "MailchimpSignupIntro" => "Varchar(255)",
9
        "MailchimpSignupLabel" => "Varchar(30)"
10
    );
11
12
    public function updateCMSFields(FieldList $fields)
13
    {
14
        $fields->addFieldsToTab(
15
            "Root.Newsletter",
16
            array(
17
                new TextField("MailchimpSignupHeader", _t("EcommerceMailchimpSignup.HEADER", "Header")),
18
                new TextField("MailchimpSignupIntro", _t("EcommerceMailchimpSignup.INTRO", "Intro")),
19
                new TextField("MailchimpSignupLabel", _t("EcommerceMailchimpSignup.LABEL", "Label"))
20
            )
21
        );
22
    }
23
}
24