USPhoneNumberField   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A include_js() 0 6 1
A Field() 0 7 1
1
<?php
2
3
class USPhoneNumberField extends TextField
4
{
5
6
    /**
7
     * Includes the JavaScript neccesary for this field to work using the {@link Requirements} system.
8
     */
9
    public static function include_js()
10
    {
11
        Requirements::javascript(FRAMEWORK_DIR.'/thirdparty/jquery/jquery.js');
12
        Requirements::javascript('us_phone_number/javascript/USPhoneNumber.js');
13
        Requirements::themedCSS('USPhoneNumber', 'us_phone_number');
14
    }
15
16
    public function Field($properties = array())
17
    {
18
        $this->addExtraClass('text');
19
        $return = parent::Field($properties = array());
20
        self::include_js();
21
        return $return;
22
    }
23
}
24