Conditions | 6 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
38 | 6 | public function __construct( ChameleonTemplate $template, \DOMElement $domElement = null, $indent = 0 ) { |
|
39 | |||
40 | 6 | if ( !is_null( $domElement ) ) { |
|
41 | |||
42 | 5 | $span = $domElement->getAttribute( 'span' ); |
|
43 | |||
44 | 5 | if ( ( !is_int( $span ) && !ctype_digit( $span ) ) || ( $span < 1 ) || ( $span > 12 ) ) { |
|
45 | 4 | $span = '12'; |
|
46 | 4 | } |
|
47 | |||
48 | 5 | } else { |
|
49 | 1 | $span = '12'; |
|
50 | } |
||
51 | |||
52 | 6 | parent::__construct( $template, $domElement, $indent ); |
|
53 | |||
54 | 6 | $this->addClasses( "col-lg-$span" ); |
|
55 | 6 | } |
|
56 | |||
58 |