FacebookMetadataSiteConfig   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 6 1
1
<?php
2
3
class FacebookMetadataSiteConfig 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...
4
{
5
    public static $db = array(
6
        'SkipToMainContentAccessKey' => 'VarChar(1)',
7
    );
8
9
    public static $has_one = array(
10
        'FacebookLogo' => 'Image',
11
    );
12
13
    public function updateCMSFields(FieldList $fields)
14
    {
15
        $fields->renameField('SkipToMainContentAccessKey', _t('AccessKey.SKIP_TO_MAIN_CONTENT_ACCESS_KEY'));
16
        $fields->addFieldToTab('Root.FacebookMetadata', new UploadField('FacebookLogo', _t('Facebook.METADATA_LOGO',
17
            'Image that will show in facebook when linking to this site. The image should be a square of minimum size 200px')));
18
    }
19
}
20