Completed
Push — master ( 3e8704...4367a8 )
by Jean-Christophe
03:21
created

HtmlIconGroups::getIcon()   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 1
1
<?php
2
3
namespace Ajax\semantic\html\elements;
4
5
use Ajax\semantic\html\base\HtmlSemDoubleElement;
6
/**
7
 * Semantic Icons group component
8
 * @see http://semantic-ui.com/elements/icon.html#/definition
9
 * @author jc
10
 * @version 1.001
11
 */
12
class HtmlIconGroups extends HtmlSemDoubleElement {
13
14
	public function __construct($identifier,$size="") {
15
		parent::__construct($identifier, "i");
16
		$this->setProperty("class", "icons");
17
		$this->setSize($size);
18
	}
19
20 View Code Duplication
	public function addIcon($icon,$size=""){
0 ignored issues
show
Duplication introduced by
This method 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...
21
		$iconO=$icon;
22
		if(\is_string($icon)){
23
			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
24
			$iconO->setSize($size);
25
		}
26
		$this->addContent($iconO);
27
	}
28
29
	public function getIcon($index){
30
		return $this->content[$index];
31
	}
32
}