Completed
Push — master ( 195028...450487 )
by Jason
9s
created

EmailSignupBlock::singular_name()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3 View Code Duplication
class EmailSignupBlock extends Block
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
4
{
5
    /**
6
     * @return string
7
     */
8 12
    public function singular_name()
9
    {
10 12
        return _t('EmailSignupBlock.SINGULARNAME', 'Email Signup Block');
11
    }
12
13
    /**
14
     * @return string
15
     */
16 1
    public function plural_name()
17
    {
18 1
        return _t('EmailSignupBlock.PLURALNAME', 'Email Signup Blocks');
19
    }
20
21
    /**
22
     * @var array
23
     */
24
    private static $db = [
25
        'EmbedCode' => 'HTMLText',
26
    ];
27
28
    /**
29
     * @return FieldList
30
     */
31 1
    public function getCMSFields()
32
    {
33 1
        $fields = parent::getCMSFields();
34
35 1
        $fields->addFieldToTab('Root.Main', TextareaField::create('EmbedCode')->setTitle('Embed code for signup form'));
36
37 1
        return $fields;
38
    }
39
}