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

HtmlCheckbox::slider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 3
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
}