MapsSiteTree   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A MetaTags() 0 11 3
1
<?php
2
3
/**
4
 * @author    Donatas Navidonskis <[email protected]>
5
 * @since     2017
6
 * @class     MapsSiteTree
7
 *
8
 */
9
class MapsSiteTree 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
    public function MetaTags(&$tags) {
12
        $api = \GoogleMapField::config()->api;
13
14
        if (empty($api)) {
15
            $api = \SiteConfig::current_site_config()->GoogleMapsApiKey;
16
        }
17
18
        if (! empty($api)) {
19
            $tags .= "<meta property=\"maps:key\" content=\"{$api}\" />\n";
20
        }
21
    }
22
}