SiteConfigExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 15 1
1
<?php
2
3
namespace Firesphere\GoogleMapsField\Extensions;
4
5
use SilverStripe\Forms\FieldList;
6
use SilverStripe\Forms\TextField;
7
use SilverStripe\ORM\DataExtension;
8
9
/**
10
 * Class \Firesphere\GoogleMapsField\Extensions\SiteConfigExtension
11
 *
12
 * @property \SilverStripe\SiteConfig\SiteConfig|\Firesphere\GoogleMapsField\Extensions\SiteConfigExtension $owner
13
 * @property string $MapsBrowserKey
14
 * @property string $MapsServerKey
15
 */
16
class SiteConfigExtension extends DataExtension
17
{
18
    private static $db = [
1 ignored issue
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...
19
        'MapsBrowserKey' => 'Varchar(255)',
20
        'MapsServerKey' => 'Varchar(255)',
21
    ];
22
23
    public function updateCMSFields(FieldList $fields)
24
    {
25
        parent::updateCMSFields($fields);
26
27
        $fields->addFieldsToTab('Root.GoogleMaps', [
28
            TextField::create(
29
                'MapsBrowserKey',
30
                _t(self::class . 'BROWSERKEY', 'Google API Browser key for address search')
31
            ),
32
            TextField::create(
33
                'MapsServerKey',
34
                _t(self::class . 'SERVERKEY', 'Google API Server key for geolocation')
35
            ),
36
        ]);
37
    }
38
}
39