Passed
Push — master ( dc691e...712280 )
by Jean-Christophe
02:04
created
Ajax/semantic/html/content/HtmlStepItem.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,46 +8,46 @@
 block discarded – undo
8 8
 class HtmlStepItem extends HtmlAbsractItem {
9 9
 
10 10
 	public function __construct($identifier, $content) {
11
-		parent::__construct($identifier,"step",$content);
11
+		parent::__construct($identifier, "step", $content);
12 12
 	}
13
-	protected function initContent($content){
14
-		if(\is_array($content)){
13
+	protected function initContent($content) {
14
+		if (\is_array($content)) {
15 15
 			$icon=JArray::getValue($content, "icon", 0);
16 16
 			$title=JArray::getValue($content, "title", 1);
17 17
 			$desc=JArray::getValue($content, "description", 2);
18 18
 			$status=JArray::getValue($content, "status", 3);
19
-			if(isset($icon)){
19
+			if (isset($icon)) {
20 20
 				$this->setIcon($icon);
21 21
 			}
22
-			if(isset($status)){
22
+			if (isset($status)) {
23 23
 				$this->setStatus($status);
24 24
 			}
25
-			if(isset($title)){
26
-				$this->setTitle($title,$desc);
25
+			if (isset($title)) {
26
+				$this->setTitle($title, $desc);
27 27
 			}
28
-		}else{
28
+		} else {
29 29
 			$this->setContent($content);
30 30
 		}
31 31
 	}
32 32
 
33
-	public function setActive($value=true){
34
-		if($value)
33
+	public function setActive($value=true) {
34
+		if ($value)
35 35
 			$this->setStatus(StepStatus::ACTIVE);
36 36
 		else
37 37
 			$this->setStatus(StepStatus::NONE);
38 38
 		return $this;
39 39
 	}
40 40
 
41
-	public function setCompleted(){
42
-		$this->removePropertyValues("class", [StepStatus::COMPLETED,StepStatus::DISABLED]);
41
+	public function setCompleted() {
42
+		$this->removePropertyValues("class", [StepStatus::COMPLETED, StepStatus::DISABLED]);
43 43
 		return $this->setStatus(StepStatus::COMPLETED);
44 44
 	}
45 45
 
46
-	public function setStatus($status){
46
+	public function setStatus($status) {
47 47
 		return $this->addToPropertyCtrl("class", $status, StepStatus::getConstants());
48 48
 	}
49 49
 
50
-	public function removeStatus(){
50
+	public function removeStatus() {
51 51
 		$this->removePropertyValues("class", StepStatus::getConstants());
52 52
 	}
53 53
 }
Please login to merge, or discard this patch.
Ajax/common/html/traits/BaseHtmlPropertiesTrait.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
9 9
  * @author jc
10 10
  * @property BaseWidget $_self
11 11
  */
12
-trait BaseHtmlPropertiesTrait{
12
+trait BaseHtmlPropertiesTrait {
13 13
 
14
-	protected $properties=array ();
14
+	protected $properties=array();
15 15
 	abstract protected function ctrl($name, $value, $typeCtrl);
16 16
 	abstract protected function removeOldValues(&$oldValue, $allValues);
17
-	abstract protected function _getElementBy($callback,$elements);
17
+	abstract protected function _getElementBy($callback, $elements);
18 18
 	public function getProperties() {
19 19
 		return $this->_self->properties;
20 20
 	}
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
 
41 41
 	public function addToProperty($name, $value, $separator=" ") {
42 42
 		if (\is_array($value)) {
43
-			foreach ( $value as $v ) {
43
+			foreach ($value as $v) {
44 44
 				$this->_self->addToProperty($name, $v, $separator);
45 45
 			}
46
-		} else if ($value !== "" && $this->_self->propertyContains($name, $value) === false) {
47
-			if(isset($this->_self->properties[$name])){
46
+		} else if ($value!=="" && $this->_self->propertyContains($name, $value)===false) {
47
+			if (isset($this->_self->properties[$name])) {
48 48
 				$v=$this->_self->properties[$name];
49
-				if (isset($v) && $v !== "")
50
-					$v=$v . $separator . $value;
49
+				if (isset($v) && $v!=="")
50
+					$v=$v.$separator.$value;
51 51
 					else
52 52
 						$v=$value;
53 53
 	
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	}
87 87
 
88 88
 	public function addToPropertyCtrlCheck($name, $value, $typeCtrl) {
89
-		if ($this->_self->ctrl($name, $value, $typeCtrl) === true) {
89
+		if ($this->_self->ctrl($name, $value, $typeCtrl)===true) {
90 90
 			return $this->_self->addToProperty($name, $value);
91 91
 		}
92 92
 		return $this;
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
 	}
108 108
 
109 109
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
110
-		if ($this->_self->ctrl($name, $value, $typeCtrl) === true)
110
+		if ($this->_self->ctrl($name, $value, $typeCtrl)===true)
111 111
 			return $this->_self->setProperty($name, $value);
112 112
 			return $this;
113 113
 	}
114 114
 
115
-	protected function getElementByPropertyValue($propertyName,$value, $elements) {
116
-		return $this->_self->_getElementBy(function(BaseHtml $element) use ($propertyName,$value){return $element->propertyContains($propertyName, $value) === true;}, $elements);
115
+	protected function getElementByPropertyValue($propertyName, $value, $elements) {
116
+		return $this->_self->_getElementBy(function(BaseHtml $element) use ($propertyName, $value){return $element->propertyContains($propertyName, $value)===true; }, $elements);
117 117
 	}
118 118
 }
Please login to merge, or discard this patch.