TypeKitSiteConfigExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 1
c 2
b 0
f 2
lcom 0
cbo 4
dl 0
loc 22
ccs 9
cts 9
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 10 1
1
<?php namespace StudioBonito\SilverStripe\TypeKit\Extensions;
2
3
use FieldList;
4
use FormField;
5
use TextField;
6
7
/**
8
 * Add configuration option to SiteConfig for setting the TypeKit ID.
9
 *
10
 * @author       Tom Densham <[email protected]>
11
 * @copyright    Studio Bonito Ltd.
12
 */
13
class TypeKitSiteConfigExtension extends \DataExtension
14
{
15
    /**
16
     * List of database fields. {@link DataObject::$db}
17
     *
18
     * @var array
19
     */
20
    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...
21
        'TypeKitID' => 'Varchar(32)',
22
    );
23
24 3
    public function updateCMSFields(FieldList $fields)
25
    {
26 3
        $fields->addFieldToTab(
27 3
            'Root.Services.TypeKit',
28 3
            TextField::create(
29 3
                'TypeKitID',
30 3
                _t('TypeKitSiteConfigExtension.TYPEKITID', FormField::name_to_label('TypeKitID'))
31 3
            )
32 3
        );
33 3
    }
34
}
35