Passed
Push — master ( d463f7...97a77b )
by Jean-Christophe
02:20
created
Ajax/service/JQueryAjaxEffect.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace Ajax\service;
3 3
 class JQueryAjaxEffect {
4
-	public static function none($responseElement,$jqueryDone="html"){
4
+	public static function none($responseElement, $jqueryDone="html") {
5 5
 		return "\t$({$responseElement}).{$jqueryDone}( data );\n";
6 6
 	}
7 7
 
8
-	public static function fade($responseElement,$jqueryDone="html"){
8
+	public static function fade($responseElement, $jqueryDone="html") {
9 9
 		return "\t$({$responseElement}).hide().{$jqueryDone}( data ).fadeIn();\n";
10 10
 	}
11 11
 
12
-	public static function slide($responseElement,$jqueryDone="html"){
12
+	public static function slide($responseElement, $jqueryDone="html") {
13 13
 		return "\t$({$responseElement}).hide().{$jqueryDone}( data ).slideDown();\n";
14 14
 	}
15 15
 }
Please login to merge, or discard this patch.
Ajax/common/html/traits/NavElementTrait.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,22 +8,22 @@  discard block
 block discarded – undo
8 8
  * @property string $root
9 9
  * @property string $attr
10 10
  */
11
-trait NavElementTrait{
11
+trait NavElementTrait {
12 12
 
13 13
 	abstract public function contentAsString();
14 14
 	/**
15 15
 	 * Generate the jquery script to set the elements to the HtmlNavElement
16 16
 	 * @param JsUtils $jsUtils
17 17
 	 */
18
-	public function jsSetContent(JsUtils $jsUtils){
19
-		$jsUtils->html("#".$this->identifier,str_replace("\"","'", $this->contentAsString()),true);
18
+	public function jsSetContent(JsUtils $jsUtils) {
19
+		$jsUtils->html("#".$this->identifier, str_replace("\"", "'", $this->contentAsString()), true);
20 20
 	}
21 21
 
22 22
 	public function getRoot() {
23 23
 		return $this->root;
24 24
 	}
25 25
 	public function setRoot($root) {
26
-		$this->root = $root;
26
+		$this->root=$root;
27 27
 		return $this;
28 28
 	}
29 29
 	public function getAttr() {
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
 	 * @return HtmlNavElement
37 37
 	 */
38 38
 	public function setAttr($attr) {
39
-		$this->attr = $attr;
39
+		$this->attr=$attr;
40 40
 		return $this;
41 41
 	}
42 42
 
43 43
 	public function __call($method, $args) {
44
-		if(isset($this->$method) && is_callable($this->$method)) {
44
+		if (isset($this->$method) && is_callable($this->$method)) {
45 45
 			return call_user_func_array(
46 46
 					$this->$method,
47 47
 					$args
@@ -49,5 +49,5 @@  discard block
 block discarded – undo
49 49
 		}
50 50
 	}
51 51
 
52
-	abstract public function fromDispatcher(JsUtils $js,$dispatcher,$startIndex=0);
52
+	abstract public function fromDispatcher(JsUtils $js, $dispatcher, $startIndex=0);
53 53
 }
Please login to merge, or discard this patch.
Ajax/common/components/SimpleComponent.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,27 +18,27 @@  discard block
 block discarded – undo
18 18
 
19 19
 	public function __construct(JsUtils $js=NULL) {
20 20
 		parent::__construct($js);
21
-		$this->events=array ();
21
+		$this->events=array();
22 22
 	}
23 23
 
24 24
 	protected function compileEvents() {
25
-		foreach ( $this->events as $event => $jsCode ) {
25
+		foreach ($this->events as $event => $jsCode) {
26 26
 			$itemSelector=JString::getValueBetween($event);
27
-			if($event=="execute"){
27
+			if ($event=="execute") {
28 28
 				$this->jquery_code_for_compile []=$jsCode;
29
-			}else if($event=="beforeExecute"){
29
+			} else if ($event=="beforeExecute") {
30 30
 				\array_unshift($this->jquery_code_for_compile, $jsCode);
31
-			}else{
31
+			} else {
32 32
 				$selector=$this->_createSelector($itemSelector, $this->attachTo);
33 33
 				$this->jquery_code_for_compile []="$( \"".$selector."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
34 34
 			}
35 35
 		}
36 36
 	}
37 37
 
38
-	protected function _createSelector($itemSelector,$selector){
39
-		if(!isset($itemSelector))
38
+	protected function _createSelector($itemSelector, $selector) {
39
+		if (!isset($itemSelector))
40 40
 			$itemSelector=$this->itemSelector;
41
-		if(isset($itemSelector) && $itemSelector!=="")
41
+		if (isset($itemSelector) && $itemSelector!=="")
42 42
 			$selector.=" ".$itemSelector;
43 43
 		return $selector;
44 44
 	}
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		$result=implode("\n", $this->jquery_code_for_compile);
48 48
 		$result=str_ireplace("\"%", "", $result);
49 49
 		$result=str_ireplace("%\"", "", $result);
50
-		$result=str_replace(array (
50
+		$result=str_replace(array(
51 51
 				"\\n",
52 52
 				"\\r",
53 53
 				"\\t"
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function getScript() {
59 59
 		$allParams=$this->params;
60
-		$this->jquery_code_for_compile=array ();
60
+		$this->jquery_code_for_compile=array();
61 61
 		$this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).");";
62 62
 		$this->compileEvents();
63 63
 		return $this->compileJQueryCode();
Please login to merge, or discard this patch.
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 			$itemSelector=JString::getValueBetween($event);
27 27
 			if($event=="execute"){
28 28
 				$this->jquery_code_for_compile []=$jsCode;
29
-			}else if($event=="beforeExecute"){
29
+			} else if($event=="beforeExecute"){
30 30
 				\array_unshift($this->jquery_code_for_compile, $jsCode);
31
-			}else{
31
+			} else{
32 32
 				$selector=$this->_createSelector($itemSelector, $this->attachTo);
33 33
 				$this->jquery_code_for_compile []="$( \"".$selector."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});";
34 34
 			}
@@ -36,10 +36,12 @@  discard block
 block discarded – undo
36 36
 	}
37 37
 
38 38
 	protected function _createSelector($itemSelector,$selector){
39
-		if(!isset($itemSelector))
40
-			$itemSelector=$this->itemSelector;
41
-		if(isset($itemSelector) && $itemSelector!=="")
42
-			$selector.=" ".$itemSelector;
39
+		if(!isset($itemSelector)) {
40
+					$itemSelector=$this->itemSelector;
41
+		}
42
+		if(isset($itemSelector) && $itemSelector!=="") {
43
+					$selector.=" ".$itemSelector;
44
+		}
43 45
 		return $selector;
44 46
 	}
45 47
 
@@ -82,8 +84,9 @@  discard block
 block discarded – undo
82 84
 
83 85
 	protected function setParamCtrl($key, $value, $typeCtrl) {
84 86
 		if (\is_array($typeCtrl)) {
85
-			if (array_search($value, $typeCtrl)===false)
86
-				throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
87
+			if (array_search($value, $typeCtrl)===false) {
88
+							throw new \Exception("La valeur passée a propriété `".$key."` pour le composant `".$this->uiName."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}");
89
+			}
87 90
 		} else {
88 91
 			if (!$typeCtrl($value)) {
89 92
 				throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key." au composant ".$this->uiName);
Please login to merge, or discard this patch.
Ajax/semantic/components/Sticky.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 		return $this->setParam("context", $value);
22 22
 	}
23 23
 
24
-	public function setOffset($offset=0){
24
+	public function setOffset($offset=0) {
25 25
 		return $this->setParam("offset", $offset);
26 26
 	}
27 27
 }
Please login to merge, or discard this patch.
Ajax/semantic/components/Checkbox.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 		$this->params["onUnchecked"]="%function(){".$value."}%";
21 21
 	}
22 22
 
23
-	public function setOnChange($value){
23
+	public function setOnChange($value) {
24 24
 		$this->params["onChange"]="%function(){".$value."}%";
25 25
 	}
26 26
 }
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/semantic/html/base/traits/AttachedTrait.php 1 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.