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

HtmlTextarea   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A setValue() 0 5 2
A setPlaceholder() 0 5 2
A setRows() 0 3 1
1
<?php
2
3
namespace Ajax\common\html\html5;
4
5
use Ajax\common\html\HtmlDoubleElement;
6
use Ajax\service\JString;
7
8
class HtmlTextarea extends HtmlDoubleElement {
9
10
	public function __construct($identifier,$value=NULL,$placeholder=NULL,$rows=NULL) {
11
		parent::__construct($identifier, "textarea");
12
		$this->setValue($value);
13
		$this->setPlaceholder($placeholder);
14
		if(isset($rows))
15
			$this->setRows($rows);
16
	}
17
	public function setValue($value) {
18
		if(isset($value))
19
			$this->setContent($value);
20
		return $this;
21
	}
22
23
	public function setPlaceholder($value){
24
		if(JString::isNotNull($value))
25
			$this->setProperty("placeholder", $value);
26
		return $this;
27
	}
28
29
	public function setRows($count){
30
		$this->setProperty("rows", $count);
31
	}
32
}