Completed
Push — master ( 73e21a...085edf )
by Jean-Christophe
04:37
created

HtmlImg   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 15
rs 10

2 Methods

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