Completed
Push — master ( 916f6f...ea2a7d )
by Jean-Christophe
03:42
created

HtmlCheckbox   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 17
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A slider() 0 3 1
A toggle() 0 3 1
1
<?php
2
3
namespace Ajax\semantic\html\modules\checkbox;
4
5
use Ajax\semantic\html\modules\checkbox\AbstractCheckbox;
6
use Ajax\semantic\html\base\constants\CheckboxType;
7
8
class HtmlCheckbox extends AbstractCheckbox {
9
10
	public function __construct($identifier, $label=NULL, $value=NULL, $checkboxType=NULL) {
11
		parent::__construct($identifier, $identifier, $label, $value, "checkbox", "checkbox");
12
		if (isset($checkboxType)===true) {
13
			$this->setType($checkboxType);
14
		}
15
	}
16
17
	public static function slider($identifier, $label="", $value=NULL) {
18
		return new HtmlCheckbox($identifier, $label, $value, CheckboxType::SLIDER);
19
	}
20
21
	public static function toggle($identifier, $label="", $value=NULL) {
22
		return new HtmlCheckbox($identifier, $label, $value, CheckboxType::TOGGLE);
23
	}
24
}