Completed
Push — master ( 3cf661...c0f044 )
by Jean-Christophe
03:28
created

HtmlFormRadio::__construct()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 13
Code Lines 11

Duplication

Lines 13
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 13
loc 13
rs 9.4285
cc 3
eloc 11
nc 4
nop 4
1
<?php
2
3
namespace Ajax\semantic\html\collections\form;
4
5
use Ajax\semantic\html\collections\form\HtmlFormInput;
6
/**
7
 * Semantic Radio component
8
 * @see http://semantic-ui.com/collections/form.html#radio
9
 * @author jc
10
 * @version 1.001
11
 */
12 View Code Duplication
class HtmlFormRadio extends HtmlFormInput {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
14
	public function __construct($identifier, $name=NULL,$label=NULL,$value=NULL) {
15
		parent::__construct($identifier, $label, "radio", $value=NULL);
16
		if(isset($name))
17
			$this->getField()->setProperty("name", $name);
18
		if(isset($label)){
19
			$this->swapLabel();
20
			$label=$this->getLabel();
21
			$label->setClass="hidden";
22
			$label->setProperty("tabindex",0);
23
		}
24
		$this->setClass("ui radio checkbox");
25
		$this->wrap("<div class='field'>","</div>");
26
	}
27
}