SEO_FacebookDomainInsights_Member_DataExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 15 1
1
<?php
2
3
/**
4
 * Adds Facebook Domain Insight data to Member.
5
 *
6
 * @package silverstripe-seo
7
 * @subpackage facebook-domain-insights
8
 * @author Andrew Gerber <[email protected]>
9
 * @version 1.0.0
10
 *
11
 */
12
class SEO_FacebookDomainInsights_Member_DataExtension 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...
13
{
14
15
    /* Overload Variable
16
     ------------------------------------------------------------------------------*/
17
18
    private static $db = array(
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...
19
        'FacebookProfileID' => 'Varchar(16)',
20
    );
21
    private static $has_one = array(
0 ignored issues
show
Unused Code introduced by
The property $has_one 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...
22
        'FacebookAdmin' => 'SiteConfig',
23
    );
24
25
26
    /* Overload Methods
27
    ------------------------------------------------------------------------------*/
28
29
    // updateCMSFields
30
    public function updateCMSFields(FieldList $fields)
31
    {
32
33
        // configuration
34
        $tab = 'Root.SEO';
35
36
        // author
37
        $fields->addFieldsToTab($tab, array(
38
            TextField::create('FacebookProfileID', 'Facebook Profile ID') // @todo validation
39
        ));
40
41
        // remove FacebookAdmin from user profile
42
        $fields->removeByName('FacebookAdminID');
43
44
    }
45
46
}
47