Completed
Push — master ( db82f0...0ba4b1 )
by Jean-Christophe
03:22
created

HtmlImage   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setCircular() 0 3 1
A asAvatar() 0 5 2
1
<?php
2
3
namespace Ajax\semantic\html\elements;
4
5
use Ajax\common\html\html5\HtmlImg;
6
use Ajax\semantic\html\base\traits\BaseTrait;
7
8
class HtmlImage extends HtmlImg {
9
	use BaseTrait;
10
11
	public function __construct($identifier, $src="", $alt="") {
12
		parent::__construct($identifier, $src, $alt);
13
		$this->_baseClass="ui image";
14
		$this->setClass($this->_baseClass);
15
	}
16
17
	public function setCircular(){
18
		return $this->addToProperty("class", "circular");
19
	}
20
21
	public function asAvatar($caption=NULL){
22
		if(isset($caption))
23
			$this->wrap("",$caption);
24
		return $this->addToProperty("class", "avatar");
25
	}
26
}