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

HtmlImg::asAvatar()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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