Completed
Push — master ( ec98fe...e6cade )
by Donata
02:32 queued 10s
created

MapsSiteConfig   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 8 1
1
<?php
2
3
/**
4
 * @author    Donatas Navidonskis <[email protected]>
5
 * @since     2017
6
 * @class     MapsSiteConfig
7
 *
8
 */
9
class MapsSiteConfig 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...
10
11
    /**
12
     * @var array
13
     * @config
14
     */
15
    private static $db = [
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...
16
        'GoogleMapsApiKey' => 'Varchar(255)',
17
    ];
18
19
    public function updateCMSFields(FieldList $fields) {
20
        $fields->addFieldToTab('Root.Main', \TextField::create(
21
            'GoogleMapsApiKey',
22
            _t('MapsSiteConfig.GOOGLE_MAPS_API_KEY', 'Google maps API key')
23
        ));
24
25
        parent::updateCMSFields($fields);
26
    }
27
}