Passed
Push — master ( dc691e...712280 )
by Jean-Christophe
02:04
created
Ajax/semantic/html/content/HtmlStepItem.php 2 patches
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.
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,16 +25,17 @@
 block discarded – undo
25 25
 			if(isset($title)){
26 26
 				$this->setTitle($title,$desc);
27 27
 			}
28
-		}else{
28
+		} else{
29 29
 			$this->setContent($content);
30 30
 		}
31 31
 	}
32 32
 
33 33
 	public function setActive($value=true){
34
-		if($value)
35
-			$this->setStatus(StepStatus::ACTIVE);
36
-		else
37
-			$this->setStatus(StepStatus::NONE);
34
+		if($value) {
35
+					$this->setStatus(StepStatus::ACTIVE);
36
+		} else {
37
+					$this->setStatus(StepStatus::NONE);
38
+		}
38 39
 		return $this;
39 40
 	}
40 41
 
Please login to merge, or discard this patch.
Ajax/common/html/traits/BaseHtmlPropertiesTrait.php 2 patches
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.
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
 	}
35 35
 
36 36
 	public function getProperty($name) {
37
-		if (array_key_exists($name, $this->_self->properties))
38
-			return $this->_self->properties[$name];
37
+		if (array_key_exists($name, $this->_self->properties)) {
38
+					return $this->_self->properties[$name];
39
+		}
39 40
 	}
40 41
 
41 42
 	public function addToProperty($name, $value, $separator=" ") {
@@ -46,10 +47,11 @@  discard block
 block discarded – undo
46 47
 		} else if ($value !== "" && $this->_self->propertyContains($name, $value) === false) {
47 48
 			if(isset($this->_self->properties[$name])){
48 49
 				$v=$this->_self->properties[$name];
49
-				if (isset($v) && $v !== "")
50
-					$v=$v . $separator . $value;
51
-					else
52
-						$v=$value;
50
+				if (isset($v) && $v !== "") {
51
+									$v=$v . $separator . $value;
52
+				} else {
53
+											$v=$value;
54
+					}
53 55
 	
54 56
 				return $this->_self->setProperty($name, $v);
55 57
 			}
@@ -73,8 +75,9 @@  discard block
 block discarded – undo
73 75
 	}
74 76
 
75 77
 	protected function addToPropertyUnique($name, $value, $typeCtrl) {
76
-		if (is_string($typeCtrl) && @class_exists($typeCtrl, true))
77
-			$typeCtrl=$typeCtrl::getConstants();
78
+		if (is_string($typeCtrl) && @class_exists($typeCtrl, true)) {
79
+					$typeCtrl=$typeCtrl::getConstants();
80
+		}
78 81
 			if (\is_array($typeCtrl)) {
79 82
 				$this->_self->removeOldValues($this->_self->properties[$name], $typeCtrl);
80 83
 			}
@@ -93,8 +96,9 @@  discard block
 block discarded – undo
93 96
 	}
94 97
 
95 98
 	public function removeProperty($name) {
96
-		if (\array_key_exists($name, $this->_self->properties))
97
-			unset($this->_self->properties[$name]);
99
+		if (\array_key_exists($name, $this->_self->properties)) {
100
+					unset($this->_self->properties[$name]);
101
+		}
98 102
 			return $this;
99 103
 	}
100 104
 
@@ -107,8 +111,9 @@  discard block
 block discarded – undo
107 111
 	}
108 112
 
109 113
 	protected function setPropertyCtrl($name, $value, $typeCtrl) {
110
-		if ($this->_self->ctrl($name, $value, $typeCtrl) === true)
111
-			return $this->_self->setProperty($name, $value);
114
+		if ($this->_self->ctrl($name, $value, $typeCtrl) === true) {
115
+					return $this->_self->setProperty($name, $value);
116
+		}
112 117
 			return $this;
113 118
 	}
114 119
 
Please login to merge, or discard this patch.