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

MapsSiteConfig::updateCMSFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 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
}