TypeKitSiteConfigExtension::updateCMSFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 10
ccs 9
cts 9
cp 1
rs 9.4286
cc 1
eloc 6
nc 1
nop 1
crap 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