FacebookLikeBoxPage   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCMSFields() 0 9 1
1
<?php
2
/**
3
* Defines the FAQ page type - initial code created by ss generator.
4
*/
5
class FacebookLikeBoxPage extends Page
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...
6
{
7
    public static $db = array(
8
        'FacebookURL' => 'Text',
9
        'PageWidth' => 'Int',
10
    );
11
12
    public function getCMSFields()
13
    {
14
        $fields = parent::getCMSFields();
15
16
        $fields->addFieldToTab('Root.Facebook', new TextField('FacebookURL'));
17
        $fields->addFieldToTab('Root.Facebook', new NumericField('PageWidth', 'Width of stream in pixels'));
18
19
        return $fields;
20
    }
21
}
22
23
class FacebookLikeBoxPage_Controller extends Page_Controller
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
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...
Coding Style introduced by
This class is not in CamelCase format.

Classes in PHP are usually named in CamelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.

Thus the name database provider becomes DatabaseProvider.

Loading history...
24
{
25
}
26