Completed
Push — master ( ef9455...966ba4 )
by Jean-Christophe
02:39
created
Ajax/semantic/html/collections/form/HtmlFormInput.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,16 +8,16 @@
 block discarded – undo
8 8
 class HtmlFormInput extends HtmlFormField {
9 9
 	use TextFieldsTrait;
10 10
 
11
-	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
12
-		if(!isset($placeholder) && $type==="text")
11
+	public function __construct($identifier, $label=NULL, $type="text", $value=NULL, $placeholder=NULL) {
12
+		if (!isset($placeholder) && $type==="text")
13 13
 			$placeholder=$label;
14
-		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
14
+		parent::__construct("field-".$identifier, new HtmlInput($identifier, $type, $value, $placeholder), $label);
15 15
 		$this->_identifier=$identifier;
16 16
 	}
17 17
 
18
-	public function getDataField(){
19
-		$field= $this->getField();
20
-		if($field instanceof HtmlInput)
18
+	public function getDataField() {
19
+		$field=$this->getField();
20
+		if ($field instanceof HtmlInput)
21 21
 			$field=$field->getDataField();
22 22
 		return $field;
23 23
 	}
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,16 +9,18 @@
 block discarded – undo
9 9
 	use TextFieldsTrait;
10 10
 
11 11
 	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
12
-		if(!isset($placeholder) && $type==="text")
13
-			$placeholder=$label;
12
+		if(!isset($placeholder) && $type==="text") {
13
+					$placeholder=$label;
14
+		}
14 15
 		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
15 16
 		$this->_identifier=$identifier;
16 17
 	}
17 18
 
18 19
 	public function getDataField(){
19 20
 		$field= $this->getField();
20
-		if($field instanceof HtmlInput)
21
-			$field=$field->getDataField();
21
+		if($field instanceof HtmlInput) {
22
+					$field=$field->getDataField();
23
+		}
22 24
 		return $field;
23 25
 	}
24 26
 }
Please login to merge, or discard this patch.
Ajax/common/html/BaseHtml.php 3 patches
Doc Comments   +17 added lines patch added patch discarded remove patch
@@ -63,6 +63,10 @@  discard block
 block discarded – undo
63 63
 
64 64
 
65 65
 
66
+	/**
67
+	 * @param string $name
68
+	 * @param string[] $typeCtrl
69
+	 */
66 70
 	protected function setMemberCtrl(&$name, $value, $typeCtrl) {
67 71
 		if ($this->ctrl($name, $value, $typeCtrl) === true) {
68 72
 			return $name=$value;
@@ -80,6 +84,10 @@  discard block
 block discarded – undo
80 84
 
81 85
 
82 86
 
87
+	/**
88
+	 * @param string $name
89
+	 * @param string[] $typeCtrl
90
+	 */
83 91
 	protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") {
84 92
 		if ($this->ctrl($name, $value, $typeCtrl) === true) {
85 93
 			if (\is_array($typeCtrl)) {
@@ -90,6 +98,9 @@  discard block
 block discarded – undo
90 98
 		return $this;
91 99
 	}
92 100
 
101
+	/**
102
+	 * @param string $name
103
+	 */
93 104
 	protected function addToMember(&$name, $value, $separator=" ") {
94 105
 		$name=str_ireplace($value, "", $name) . $separator . $value;
95 106
 		return $this;
@@ -102,6 +113,9 @@  discard block
 block discarded – undo
102 113
 		$oldValue=trim($oldValue);
103 114
 	}
104 115
 
116
+	/**
117
+	 * @param \Closure $callback
118
+	 */
105 119
 	protected function _getElementBy($callback,$elements){
106 120
 		if (\is_array($elements)) {
107 121
 			$elements=\array_values($elements);
@@ -183,6 +197,9 @@  discard block
 block discarded – undo
183 197
 		return $this->_bsComponent;
184 198
 	}
185 199
 
200
+	/**
201
+	 * @param \Ajax\semantic\components\Form $bsComponent
202
+	 */
186 203
 	public function setBsComponent($bsComponent) {
187 204
 		$this->_bsComponent=$bsComponent;
188 205
 		return $this;
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
  * @version 1.3
16 16
  */
17 17
 abstract class BaseHtml extends BaseWidget {
18
-	use BaseHtmlEventsTrait,BaseHtmlPropertiesTrait;
18
+	use BaseHtmlEventsTrait, BaseHtmlPropertiesTrait;
19 19
 	protected $_template;
20 20
 	protected $tagName;
21
-	protected $_wrapBefore=array ();
22
-	protected $_wrapAfter=array ();
21
+	protected $_wrapBefore=array();
22
+	protected $_wrapAfter=array();
23 23
 	protected $_bsComponent;
24 24
 	protected $_compiled=false;
25 25
 	protected $_postCompile;
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
 	 */
33 33
 	abstract public function run(JsUtils $js);
34 34
 
35
-	private function _callSetter($setter,$key,$value,&$array){
35
+	private function _callSetter($setter, $key, $value, &$array) {
36 36
 		$result=false;
37 37
 		if (method_exists($this, $setter) && !JString::startswith($key, "_")) {
38 38
 			try {
39 39
 				$this->$setter($value);
40 40
 				unset($array[$key]);
41 41
 				$result=true;
42
-			} catch ( \Exception $e ) {
42
+			}catch (\Exception $e) {
43 43
 				$result=false;
44 44
 			}
45 45
 		}
@@ -47,17 +47,17 @@  discard block
 block discarded – undo
47 47
 	}
48 48
 
49 49
 	protected function getTemplate(JsUtils $js=NULL) {
50
-		return PropertyWrapper::wrap($this->_wrapBefore, $js) . $this->_template . PropertyWrapper::wrap($this->_wrapAfter, $js);
50
+		return PropertyWrapper::wrap($this->_wrapBefore, $js).$this->_template.PropertyWrapper::wrap($this->_wrapAfter, $js);
51 51
 	}
52 52
 
53 53
 	protected function ctrl($name, $value, $typeCtrl) {
54 54
 		if (\is_array($typeCtrl)) {
55
-			if (array_search($value, $typeCtrl) === false) {
56
-				throw new \Exception("La valeur passée `" . $value . "` à la propriété `" . $name . "` ne fait pas partie des valeurs possibles : {" . implode(",", $typeCtrl) . "}");
55
+			if (array_search($value, $typeCtrl)===false) {
56
+				throw new \Exception("La valeur passée `".$value."` à la propriété `".$name."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
57 57
 			}
58 58
 		} else {
59 59
 			if (!$typeCtrl($value)) {
60
-				throw new \Exception("La fonction " . $typeCtrl . " a retourné faux pour l'affectation de la propriété " . $name);
60
+				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$name);
61 61
 			}
62 62
 		}
63 63
 		return true;
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
 
68 68
 	protected function setMemberCtrl(&$name, $value, $typeCtrl) {
69
-		if ($this->ctrl($name, $value, $typeCtrl) === true) {
69
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
70 70
 			return $name=$value;
71 71
 		}
72 72
 		return $this;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	protected function addToMemberUnique(&$name, $value, $typeCtrl, $separator=" ") {
76 76
 		if (\is_array($typeCtrl)) {
77 77
 			$this->removeOldValues($name, $typeCtrl);
78
-			$name.=$separator . $value;
78
+			$name.=$separator.$value;
79 79
 		}
80 80
 		return $this;
81 81
 	}
@@ -83,17 +83,17 @@  discard block
 block discarded – undo
83 83
 
84 84
 
85 85
 	protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") {
86
-		if ($this->ctrl($name, $value, $typeCtrl) === true) {
86
+		if ($this->ctrl($name, $value, $typeCtrl)===true) {
87 87
 			if (\is_array($typeCtrl)) {
88 88
 				$this->removeOldValues($name, $typeCtrl);
89 89
 			}
90
-			$name.=$separator . $value;
90
+			$name.=$separator.$value;
91 91
 		}
92 92
 		return $this;
93 93
 	}
94 94
 
95 95
 	protected function addToMember(&$name, $value, $separator=" ") {
96
-		$name=str_ireplace($value, "", $name) . $separator . $value;
96
+		$name=str_ireplace($value, "", $name).$separator.$value;
97 97
 		return $this;
98 98
 	}
99 99
 
@@ -104,18 +104,18 @@  discard block
 block discarded – undo
104 104
 		$oldValue=trim($oldValue);
105 105
 	}
106 106
 
107
-	protected function _getElementBy($callback,$elements){
107
+	protected function _getElementBy($callback, $elements) {
108 108
 		if (\is_array($elements)) {
109 109
 			$elements=\array_values($elements);
110 110
 			$flag=false;
111 111
 			$index=0;
112
-			while ( !$flag && $index < sizeof($elements) ) {
112
+			while (!$flag && $index<sizeof($elements)) {
113 113
 				if ($elements[$index] instanceof BaseHtml)
114 114
 					$flag=($callback($elements[$index]));
115 115
 					$index++;
116 116
 			}
117
-			if ($flag === true)
118
-				return $elements[$index - 1];
117
+			if ($flag===true)
118
+				return $elements[$index-1];
119 119
 		} elseif ($elements instanceof BaseHtml) {
120 120
 			if ($callback($elements))
121 121
 				return $elements;
@@ -143,13 +143,13 @@  discard block
 block discarded – undo
143 143
 	}
144 144
 
145 145
 	public function fromArray($array) {
146
-		foreach ( $this as $key => $value ) {
147
-			if(array_key_exists($key, $array)===true)
148
-				$this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array);
146
+		foreach ($this as $key => $value) {
147
+			if (array_key_exists($key, $array)===true)
148
+				$this->_callSetter("set".ucfirst($key), $key, $array[$key], $array);
149 149
 		}
150
-		foreach ( $array as $key => $value ) {
151
-			if($this->_callSetter($key, $key, $value, $array)===false){
152
-				$this->_callSetter("set" . ucfirst($key), $key, $value, $array);
150
+		foreach ($array as $key => $value) {
151
+			if ($this->_callSetter($key, $key, $value, $array)===false) {
152
+				$this->_callSetter("set".ucfirst($key), $key, $value, $array);
153 153
 			}
154 154
 		}
155 155
 		return $array;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
 	public function fromDatabaseObjects($objects, $function) {
159 159
 		if (isset($objects)) {
160
-			foreach ( $objects as $object ) {
160
+			foreach ($objects as $object) {
161 161
 				$this->fromDatabaseObject($object, $function);
162 162
 			}
163 163
 		}
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 
179 179
 
180 180
 	public function getElementById($identifier, $elements) {
181
-		return $this->_getElementBy(function(BaseWidget $element) use ($identifier){return $element->getIdentifier()===$identifier;}, $elements);
181
+		return $this->_getElementBy(function(BaseWidget $element) use ($identifier){return $element->getIdentifier()===$identifier; }, $elements);
182 182
 	}
183 183
 
184 184
 	public function getBsComponent() {
@@ -191,14 +191,14 @@  discard block
 block discarded – undo
191 191
 	}
192 192
 
193 193
 	protected function compile_once(JsUtils $js=NULL, &$view=NULL) {
194
-		if(!$this->_compiled){
195
-			if(isset($js)){
194
+		if (!$this->_compiled) {
195
+			if (isset($js)) {
196 196
 				$beforeCompile=$js->getParam("beforeCompileHtml");
197
-				if(\is_callable($beforeCompile)){
198
-					$beforeCompile($this,$js,$view);
197
+				if (\is_callable($beforeCompile)) {
198
+					$beforeCompile($this, $js, $view);
199 199
 				}
200 200
 			}
201
-			if(\is_callable($this->_preCompile)){
201
+			if (\is_callable($this->_preCompile)) {
202 202
 				$pc=$this->_preCompile;
203 203
 				$pc($this);
204 204
 			}
@@ -208,29 +208,29 @@  discard block
 block discarded – undo
208 208
 	}
209 209
 
210 210
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
211
-		$this->compile_once($js,$view);
211
+		$this->compile_once($js, $view);
212 212
 		$result=$this->getTemplate($js);
213
-		foreach ( $this as $key => $value ) {
214
-			if (JString::startswith($key, "_") === false && $key !== "events") {
213
+		foreach ($this as $key => $value) {
214
+			if (JString::startswith($key, "_")===false && $key!=="events") {
215 215
 				if (\is_array($value)) {
216 216
 					$v=PropertyWrapper::wrap($value, $js);
217 217
 				} else {
218
-					if($value instanceof \stdClass)
219
-						$v=\print_r($value,true);
218
+					if ($value instanceof \stdClass)
219
+						$v=\print_r($value, true);
220 220
 					else
221 221
 						$v=$value;
222 222
 				}
223
-				$result=str_ireplace("%" . $key . "%", $v, $result);
223
+				$result=str_ireplace("%".$key."%", $v, $result);
224 224
 			}
225 225
 		}
226 226
 		if (isset($js)===true) {
227 227
 			$this->run($js);
228
-			if (isset($view) === true) {
228
+			if (isset($view)===true) {
229 229
 				$js->addViewElement($this->_identifier, $result, $view);
230 230
 			}
231 231
 		}
232 232
 
233
-		if(\is_callable($this->_postCompile)){
233
+		if (\is_callable($this->_postCompile)) {
234 234
 			$pc=$this->_postCompile;
235 235
 			$pc($this);
236 236
 		}
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
 		return $this->compile();
242 242
 	}
243 243
 
244
-	public function onPostCompile($callback){
244
+	public function onPostCompile($callback) {
245 245
 		$this->_postCompile=$callback;
246 246
 	}
247 247
 
248
-	public function onPreCompile($callback){
248
+	public function onPreCompile($callback) {
249 249
 		$this->_preCompile=$callback;
250 250
 	}
251 251
 }
Please login to merge, or discard this patch.
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -110,15 +110,18 @@  discard block
 block discarded – undo
110 110
 			$flag=false;
111 111
 			$index=0;
112 112
 			while ( !$flag && $index < sizeof($elements) ) {
113
-				if ($elements[$index] instanceof BaseHtml)
114
-					$flag=($callback($elements[$index]));
113
+				if ($elements[$index] instanceof BaseHtml) {
114
+									$flag=($callback($elements[$index]));
115
+				}
115 116
 					$index++;
116 117
 			}
117
-			if ($flag === true)
118
-				return $elements[$index - 1];
118
+			if ($flag === true) {
119
+							return $elements[$index - 1];
120
+			}
119 121
 		} elseif ($elements instanceof BaseHtml) {
120
-			if ($callback($elements))
121
-				return $elements;
122
+			if ($callback($elements)) {
123
+							return $elements;
124
+			}
122 125
 		}
123 126
 		return null;
124 127
 	}
@@ -144,8 +147,9 @@  discard block
 block discarded – undo
144 147
 
145 148
 	public function fromArray($array) {
146 149
 		foreach ( $this as $key => $value ) {
147
-			if(array_key_exists($key, $array)===true)
148
-				$this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array);
150
+			if(array_key_exists($key, $array)===true) {
151
+							$this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array);
152
+			}
149 153
 		}
150 154
 		foreach ( $array as $key => $value ) {
151 155
 			if($this->_callSetter($key, $key, $value, $array)===false){
@@ -215,10 +219,11 @@  discard block
 block discarded – undo
215 219
 				if (\is_array($value)) {
216 220
 					$v=PropertyWrapper::wrap($value, $js);
217 221
 				} else {
218
-					if($value instanceof \stdClass)
219
-						$v=\print_r($value,true);
220
-					else
221
-						$v=$value;
222
+					if($value instanceof \stdClass) {
223
+											$v=\print_r($value,true);
224
+					} else {
225
+											$v=$value;
226
+					}
222 227
 				}
223 228
 				$result=str_ireplace("%" . $key . "%", $v, $result);
224 229
 			}
Please login to merge, or discard this patch.
Ajax/ui/components/Autocomplete.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 	 * @return $this
51 51
 	 */
52 52
 	public function setSource($source) {
53
-		$source=str_ireplace(array (
53
+		$source=str_ireplace(array(
54 54
 				"\"",
55 55
 				"'"
56 56
 		), "%quote%", $source);
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/BaseTrait.php 2 patches
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
  * @property HtmlSemDoubleElement $_self
16 16
  */
17 17
 trait BaseTrait {
18
-	protected $_variations=[ ];
19
-	protected $_states=[ ];
18
+	protected $_variations=[];
19
+	protected $_states=[];
20 20
 	protected $_baseClass;
21 21
 
22 22
 	abstract protected function setPropertyCtrl($name, $value, $typeCtrl);
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
 	abstract public function setProperty($name, $value);
31 31
 
32
-	abstract public function addContent($content,$before=false);
32
+	abstract public function addContent($content, $before=false);
33 33
 
34 34
 	abstract public function onCreate($jsCode);
35 35
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		$this->_self->setProperty("class", $this->_self->getBaseClass());
51 51
 		if (\is_string($variations))
52 52
 			$variations=\explode(" ", $variations);
53
-		foreach ( $variations as $variation ) {
53
+		foreach ($variations as $variation) {
54 54
 			$this->_self->addVariation($variation);
55 55
 		}
56 56
 		return $this;
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	public function addVariations($variations=array()) {
65 65
 		if (\is_string($variations))
66 66
 			$variations=\explode(" ", $variations);
67
-		foreach ( $variations as $variation ) {
67
+		foreach ($variations as $variation) {
68 68
 			$this->_self->addVariation($variation);
69 69
 		}
70 70
 		return $this;
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	public function addStates($states=array()) {
74 74
 		if (\is_string($states))
75 75
 			$states=\explode(" ", $states);
76
-		foreach ( $states as $state ) {
76
+		foreach ($states as $state) {
77 77
 			$this->_self->addState($state);
78 78
 		}
79 79
 		return $this;
@@ -83,17 +83,17 @@  discard block
 block discarded – undo
83 83
 		$this->_self->setProperty("class", $this->_self->getBaseClass());
84 84
 		if (\is_string($states))
85 85
 			$states=\explode(" ", $states);
86
-		foreach ( $states as $state ) {
86
+		foreach ($states as $state) {
87 87
 			$this->_self->addState($state);
88 88
 		}
89 89
 		return $this;
90 90
 	}
91 91
 
92 92
 	public function addIcon($icon, $before=true) {
93
-		return $this->_self->addContent(new HtmlIcon("icon-" . $this->_self->getIdentifier(), $icon), $before);
93
+		return $this->_self->addContent(new HtmlIcon("icon-".$this->_self->getIdentifier(), $icon), $before);
94 94
 	}
95 95
 
96
-	public function addSticky($context="body"){
96
+	public function addSticky($context="body") {
97 97
 		$this->_self->onCreate("$('#".$this->_self->getIdentifier()."').sticky({ context: '".$context."'});");
98 98
 		return $this;
99 99
 	}
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 * @return HtmlSemDoubleElement
115 115
 	 */
116 116
 	public function setDisabled($disable=true) {
117
-		if($disable)
117
+		if ($disable)
118 118
 			$this->_self->addToProperty("class", "disabled");
119 119
 		return $this;
120 120
 	}
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	 *
141 141
 	 * @return HtmlSemDoubleElement
142 142
 	 */
143
-	public function asHeader(){
143
+	public function asHeader() {
144 144
 		return $this->_self->addToProperty("class", "header");
145 145
 	}
146 146
 
@@ -148,15 +148,15 @@  discard block
 block discarded – undo
148 148
 	 * show it is currently the active user selection
149 149
 	 * @return HtmlSemDoubleElement
150 150
 	 */
151
-	public function setActive($value=true){
152
-		if($value)
151
+	public function setActive($value=true) {
152
+		if ($value)
153 153
 			$this->_self->addToProperty("class", "active");
154 154
 		return $this;
155 155
 	}
156 156
 
157
-	public function setAttached($value=true){
158
-		if($value)
159
-			$this->_self->addToPropertyCtrl("class", "attached", array ("attached" ));
157
+	public function setAttached($value=true) {
158
+		if ($value)
159
+			$this->_self->addToPropertyCtrl("class", "attached", array("attached"));
160 160
 		return $this;
161 161
 	}
162 162
 
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
164 164
 	 * can be formatted to appear on dark backgrounds
165 165
 	 */
166 166
 	public function setInverted($recursive=true) {
167
-		if($recursive===true){
167
+		if ($recursive===true) {
168 168
 			$content=$this->_self->getContent();
169
-			if($content instanceof HtmlSemDoubleElement)
169
+			if ($content instanceof HtmlSemDoubleElement)
170 170
 				$content->setInverted($recursive);
171
-			elseif(\is_array($content) || $content instanceof \Traversable){
172
-				foreach ($content as $elm){
173
-					if($elm instanceof  HtmlSemDoubleElement){
171
+			elseif (\is_array($content) || $content instanceof \Traversable) {
172
+				foreach ($content as $elm) {
173
+					if ($elm instanceof  HtmlSemDoubleElement) {
174 174
 						$elm->setInverted($recursive);
175 175
 					}
176 176
 				}
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	}
185 185
 
186 186
 	public function setFloated($direction="right") {
187
-		return $this->_self->addToPropertyCtrl("class", $direction . " floated", Direction::getConstantValues("floated"));
187
+		return $this->_self->addToPropertyCtrl("class", $direction." floated", Direction::getConstantValues("floated"));
188 188
 	}
189 189
 
190 190
 	public function floatRight() {
@@ -199,14 +199,14 @@  discard block
 block discarded – undo
199 199
 		return $this->_baseClass;
200 200
 	}
201 201
 
202
-	protected function addBehavior(&$array,$key,$value,$before="",$after=""){
203
-		if(\is_string($value)){
204
-			if(isset($array[$key])){
202
+	protected function addBehavior(&$array, $key, $value, $before="", $after="") {
203
+		if (\is_string($value)) {
204
+			if (isset($array[$key])) {
205 205
 				$p=JString::replaceAtFirstAndLast($array[$key], $before, "", $after, "");
206 206
 				$array[$key]=$before.$p.$value.$after;
207
-			}else
207
+			} else
208 208
 				$array[$key]=$before.$value.$after;
209
-		}else{
209
+		} else {
210 210
 			$array[$key]=$value;
211 211
 		}
212 212
 		return $this;
Please login to merge, or discard this patch.
Braces   +28 added lines, -20 removed lines patch added patch discarded remove patch
@@ -48,8 +48,9 @@  discard block
 block discarded – undo
48 48
 
49 49
 	public function setVariations($variations) {
50 50
 		$this->_self->setProperty("class", $this->_self->getBaseClass());
51
-		if (\is_string($variations))
52
-			$variations=\explode(" ", $variations);
51
+		if (\is_string($variations)) {
52
+					$variations=\explode(" ", $variations);
53
+		}
53 54
 		foreach ( $variations as $variation ) {
54 55
 			$this->_self->addVariation($variation);
55 56
 		}
@@ -62,8 +63,9 @@  discard block
 block discarded – undo
62 63
 	}
63 64
 
64 65
 	public function addVariations($variations=array()) {
65
-		if (\is_string($variations))
66
-			$variations=\explode(" ", $variations);
66
+		if (\is_string($variations)) {
67
+					$variations=\explode(" ", $variations);
68
+		}
67 69
 		foreach ( $variations as $variation ) {
68 70
 			$this->_self->addVariation($variation);
69 71
 		}
@@ -71,8 +73,9 @@  discard block
 block discarded – undo
71 73
 	}
72 74
 
73 75
 	public function addStates($states=array()) {
74
-		if (\is_string($states))
75
-			$states=\explode(" ", $states);
76
+		if (\is_string($states)) {
77
+					$states=\explode(" ", $states);
78
+		}
76 79
 		foreach ( $states as $state ) {
77 80
 			$this->_self->addState($state);
78 81
 		}
@@ -81,8 +84,9 @@  discard block
 block discarded – undo
81 84
 
82 85
 	public function setStates($states) {
83 86
 		$this->_self->setProperty("class", $this->_self->getBaseClass());
84
-		if (\is_string($states))
85
-			$states=\explode(" ", $states);
87
+		if (\is_string($states)) {
88
+					$states=\explode(" ", $states);
89
+		}
86 90
 		foreach ( $states as $state ) {
87 91
 			$this->_self->addState($state);
88 92
 		}
@@ -114,8 +118,9 @@  discard block
 block discarded – undo
114 118
 	 * @return HtmlSemDoubleElement
115 119
 	 */
116 120
 	public function setDisabled($disable=true) {
117
-		if($disable)
118
-			$this->_self->addToProperty("class", "disabled");
121
+		if($disable) {
122
+					$this->_self->addToProperty("class", "disabled");
123
+		}
119 124
 		return $this;
120 125
 	}
121 126
 
@@ -149,14 +154,16 @@  discard block
 block discarded – undo
149 154
 	 * @return HtmlSemDoubleElement
150 155
 	 */
151 156
 	public function setActive($value=true){
152
-		if($value)
153
-			$this->_self->addToProperty("class", "active");
157
+		if($value) {
158
+					$this->_self->addToProperty("class", "active");
159
+		}
154 160
 		return $this;
155 161
 	}
156 162
 
157 163
 	public function setAttached($value=true){
158
-		if($value)
159
-			$this->_self->addToPropertyCtrl("class", "attached", array ("attached" ));
164
+		if($value) {
165
+					$this->_self->addToPropertyCtrl("class", "attached", array ("attached" ));
166
+		}
160 167
 		return $this;
161 168
 	}
162 169
 
@@ -166,9 +173,9 @@  discard block
 block discarded – undo
166 173
 	public function setInverted($recursive=true) {
167 174
 		if($recursive===true){
168 175
 			$content=$this->_self->getContent();
169
-			if($content instanceof HtmlSemDoubleElement)
170
-				$content->setInverted($recursive);
171
-			elseif(\is_array($content) || $content instanceof \Traversable){
176
+			if($content instanceof HtmlSemDoubleElement) {
177
+							$content->setInverted($recursive);
178
+			} elseif(\is_array($content) || $content instanceof \Traversable){
172 179
 				foreach ($content as $elm){
173 180
 					if($elm instanceof  HtmlSemDoubleElement){
174 181
 						$elm->setInverted($recursive);
@@ -204,9 +211,10 @@  discard block
 block discarded – undo
204 211
 			if(isset($array[$key])){
205 212
 				$p=JString::replaceAtFirstAndLast($array[$key], $before, "", $after, "");
206 213
 				$array[$key]=$before.$p.$value.$after;
207
-			}else
208
-				$array[$key]=$before.$value.$after;
209
-		}else{
214
+			} else {
215
+							$array[$key]=$before.$value.$after;
216
+			}
217
+		} else{
210 218
 			$array[$key]=$value;
211 219
 		}
212 220
 		return $this;
Please login to merge, or discard this patch.
Ajax/common/traits/JsUtilsInternalTrait.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@  discard block
 block discarded – undo
16 16
 	 */
17 17
 	protected function _compileLibrary(BaseGui $library=NULL, &$view=NULL){
18 18
 		if ($library!=NULL) {
19
-			if(isset($view))
20
-				$library->compileHtml($this, $view);
19
+			if(isset($view)) {
20
+							$library->compileHtml($this, $view);
21
+			}
21 22
 			if ($library->isAutoCompile()) {
22 23
 				$library->compile(true);
23 24
 			}
@@ -37,7 +38,9 @@  discard block
 block discarded – undo
37 38
 	}
38 39
 
39 40
 	protected function minify($input) {
40
-		if(trim($input) === "") return $input;
41
+		if(trim($input) === "") {
42
+			return $input;
43
+		}
41 44
 		return preg_replace(
42 45
 				array(
43 46
 						// Remove comment(s)
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@  discard block
 block discarded – undo
2 2
 namespace Ajax\common\traits;
3 3
 use Ajax\common\BaseGui;
4 4
 
5
-trait JsUtilsInternalTrait{
5
+trait JsUtilsInternalTrait {
6 6
 
7
-	protected $jquery_code_for_compile=array ();
8
-	protected $jquery_code_for_compile_at_last=array ();
7
+	protected $jquery_code_for_compile=array();
8
+	protected $jquery_code_for_compile_at_last=array();
9 9
 
10 10
 	protected function _addToCompile($jsScript) {
11 11
 		$this->jquery_code_for_compile[]=$jsScript;
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
 	 * @param BaseGui $library
16 16
 	 * @param mixed $view
17 17
 	 */
18
-	protected function _compileLibrary(BaseGui $library=NULL, &$view=NULL){
18
+	protected function _compileLibrary(BaseGui $library=NULL, &$view=NULL) {
19 19
 		if ($library!=NULL) {
20
-			if(isset($view))
20
+			if (isset($view))
21 21
 				$library->compileHtml($this, $view);
22 22
 			if ($library->isAutoCompile()) {
23 23
 				$library->compile(true);
@@ -25,20 +25,20 @@  discard block
 block discarded – undo
25 25
 		}
26 26
 	}
27 27
 
28
-	protected function defer($script){
28
+	protected function defer($script) {
29 29
 		$result="window.defer=function (method) {if (window.jQuery) method(); else setTimeout(function() { defer(method) }, 50);};";
30 30
 		$result.="window.defer(function(){".$script."})";
31 31
 		return $result;
32 32
 	}
33 33
 
34
-	protected function ready($script){
34
+	protected function ready($script) {
35 35
 		$result='$(document).ready(function() {'."\n";
36 36
 		$result.=$script.'})';
37 37
 		return $result;
38 38
 	}
39 39
 
40 40
 	protected function minify($input) {
41
-		if(trim($input) === "") return $input;
41
+		if (trim($input)==="") return $input;
42 42
 		return preg_replace(
43 43
 				array(
44 44
 						// Remove comment(s)
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/AttachedTrait.php 2 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -7,6 +7,11 @@
 block discarded – undo
7 7
 use Ajax\common\html\HtmlDoubleElement;
8 8
 
9 9
 trait AttachedTrait {
10
+
11
+	/**
12
+	 * @param string $name
13
+	 * @param string $value
14
+	 */
10 15
 	abstract public function addToPropertyCtrl($name, $value, $typeCtrl);
11 16
 	/**
12 17
 	 * @param HtmlSemDoubleElement $toElement
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,6 +17,6 @@
 block discarded – undo
17 17
 		if (isset($toElement) && \method_exists($toElement, "setAttached")) {
18 18
 			$toElement->setAttached(true);
19 19
 		}
20
-		return $this->addToPropertyCtrl("class", $side . " attached", Side::getConstantValues("attached"));
20
+		return $this->addToPropertyCtrl("class", $side." attached", Side::getConstantValues("attached"));
21 21
 	}
22 22
 }
Please login to merge, or discard this patch.
Ajax/semantic/html/base/constants/Social.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,5 +2,5 @@
 block discarded – undo
2 2
 namespace Ajax\semantic\html\base\constants;
3 3
 	use Ajax\common\BaseEnum;
4 4
 abstract class Social extends BaseEnum {
5
-	const FACEBOOK="facebook", TWITTER="twitter",GOOGLEPLUS="google plus",VK="vk",LINKEDIN="linkedin",INSTAGRAM="instagram",YOUTUBE="youtube",GITHUB="github";
5
+	const FACEBOOK="facebook", TWITTER="twitter", GOOGLEPLUS="google plus", VK="vk", LINKEDIN="linkedin", INSTAGRAM="instagram", YOUTUBE="youtube", GITHUB="github";
6 6
 }
Please login to merge, or discard this patch.
Ajax/semantic/components/Popup.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 	 * @return $this
28 28
 	 */
29 29
 	public function setOnShow($jsCode) {
30
-		$jsCode=str_ireplace("\"","%quote%", $jsCode);
30
+		$jsCode=str_ireplace("\"", "%quote%", $jsCode);
31 31
 		return $this->setParam("onShow", "%function(){".$jsCode."}%");
32 32
 	}
33 33
 
34
-	public function setExclusive($value){
34
+	public function setExclusive($value) {
35 35
 		return $this->setParam("exclusive", $value);
36 36
 	}
37 37
 
@@ -40,19 +40,19 @@  discard block
 block discarded – undo
40 40
 	 * @param string $popup the css selector of the popup
41 41
 	 * @return \Ajax\semantic\components\Popup
42 42
 	 */
43
-	public function setPopup($popup){
43
+	public function setPopup($popup) {
44 44
 		return $this->setParam("popup", $popup);
45 45
 	}
46 46
 
47
-	public function setInline($value){
47
+	public function setInline($value) {
48 48
 		return $this->setParam("inline", $value);
49 49
 	}
50 50
 
51
-	public function setPosition($value){
51
+	public function setPosition($value) {
52 52
 		return $this->setParam("position", $value);
53 53
 	}
54 54
 
55
-	public function setSetFluidWidth($value){
55
+	public function setSetFluidWidth($value) {
56 56
 		return $this->setParam("setFluidWidth", $value);
57 57
 	}
58 58
 }
Please login to merge, or discard this patch.
Ajax/semantic/traits/SemanticWidgetsTrait.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 	 * @param array $instances
19 19
 	 * @return DataTable
20 20
 	 */
21
-	public function dataTable($identifier,$model, $instances){
22
-		return $this->addHtmlComponent(new DataTable($identifier,$model,$instances));
21
+	public function dataTable($identifier, $model, $instances) {
22
+		return $this->addHtmlComponent(new DataTable($identifier, $model, $instances));
23 23
 	}
24 24
 
25 25
 	/**
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 	 * @param array $instances
29 29
 	 * @return JsonDataTable
30 30
 	 */
31
-	public function jsonDataTable($identifier,$model, $instances){
32
-		return $this->addHtmlComponent(new JsonDataTable($identifier,$model,$instances));
31
+	public function jsonDataTable($identifier, $model, $instances) {
32
+		return $this->addHtmlComponent(new JsonDataTable($identifier, $model, $instances));
33 33
 	}
34 34
 
35 35
 	/**
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 	 * @param object $instance
38 38
 	 * @return DataElement
39 39
 	 */
40
-	public function dataElement($identifier, $instance){
41
-		return $this->addHtmlComponent(new DataElement($identifier,$instance));
40
+	public function dataElement($identifier, $instance) {
41
+		return $this->addHtmlComponent(new DataElement($identifier, $instance));
42 42
 	}
43 43
 
44 44
 	/**
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 	 * @param object $instance
47 47
 	 * @return DataForm
48 48
 	 */
49
-	public function dataForm($identifier, $instance){
50
-		return $this->addHtmlComponent(new DataForm($identifier,$instance));
49
+	public function dataForm($identifier, $instance) {
50
+		return $this->addHtmlComponent(new DataForm($identifier, $instance));
51 51
 	}
52 52
 
53 53
 	/**
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 	 * @param object $instance
56 56
 	 * @return FormLogin
57 57
 	 */
58
-	public function defaultLogin($identifier,$instance=null){
59
-		return $this->addHtmlComponent(FormLogin::regular($identifier,$instance));
58
+	public function defaultLogin($identifier, $instance=null) {
59
+		return $this->addHtmlComponent(FormLogin::regular($identifier, $instance));
60 60
 	}
61 61
 
62 62
 	/**
@@ -64,8 +64,8 @@  discard block
 block discarded – undo
64 64
 	 * @param object $instance
65 65
 	 * @return FormLogin
66 66
 	 */
67
-	public function smallLogin($identifier,$instance=null){
68
-		return $this->addHtmlComponent(FormLogin::small($identifier,$instance));
67
+	public function smallLogin($identifier, $instance=null) {
68
+		return $this->addHtmlComponent(FormLogin::small($identifier, $instance));
69 69
 	}
70 70
 
71 71
 	/**
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 	 * @param object $instance
74 74
 	 * @return FormLogin
75 75
 	 */
76
-	public function segmentedLogin($identifier,$instance=null){
77
-		return $this->addHtmlComponent(FormLogin::attachedSegment($identifier,$instance));
76
+	public function segmentedLogin($identifier, $instance=null) {
77
+		return $this->addHtmlComponent(FormLogin::attachedSegment($identifier, $instance));
78 78
 	}
79 79
 
80 80
 	/**
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @param object $instance
83 83
 	 * @return FormAccount
84 84
 	 */
85
-	public function defaultAccount($identifier,$instance=null){
86
-		return $this->addHtmlComponent(FormAccount::regular($identifier,$instance));
85
+	public function defaultAccount($identifier, $instance=null) {
86
+		return $this->addHtmlComponent(FormAccount::regular($identifier, $instance));
87 87
 	}
88 88
 }
Please login to merge, or discard this patch.