Passed
Push — master ( 514b5f...6cf655 )
by Jean-Christophe
02:23
created
Ajax/lib/CDNGuiGen.php 1 patch
Braces   +22 added lines, -16 removed lines patch added patch discarded remove patch
@@ -14,10 +14,11 @@  discard block
 block discarded – undo
14 14
 		$this->data=$this->data ["JQueryUI"];
15 15
 		if (is_int($theme)) {
16 16
 			$themes=$this->getThemes();
17
-			if (sizeof($themes)>$theme-1)
18
-				$this->theme=$themes [$theme-1];
19
-			else
20
-				throw new \Exception("CDNGuiGen : Le numéro de thème demandé n'existe pas");
17
+			if (sizeof($themes)>$theme-1) {
18
+							$this->theme=$themes [$theme-1];
19
+			} else {
20
+							throw new \Exception("CDNGuiGen : Le numéro de thème demandé n'existe pas");
21
+			}
21 22
 		}
22 23
 		$this->theme=$theme;
23 24
 		$this->cssUrl=null;
@@ -28,16 +29,18 @@  discard block
 block discarded – undo
28 29
 	}
29 30
 
30 31
 	public function getThemes($provider=NULL) {
31
-		if (isset($provider))
32
-			return $this->data [$provider] ["themes"];
33
-		else
34
-			return $this->data [$this->provider] ["themes"];
32
+		if (isset($provider)) {
33
+					return $this->data [$provider] ["themes"];
34
+		} else {
35
+					return $this->data [$this->provider] ["themes"];
36
+		}
35 37
 	}
36 38
 
37 39
 	public function getFirstTheme($provider=NULL) {
38 40
 		$themes=$this->getThemes($provider);
39
-		if (sizeof($themes)>0)
40
-			return $themes [0];
41
+		if (sizeof($themes)>0) {
42
+					return $themes [0];
43
+		}
41 44
 		return "";
42 45
 	}
43 46
 
@@ -46,14 +49,17 @@  discard block
 block discarded – undo
46 49
 	}
47 50
 
48 51
 	public function getCss() {
49
-		if (isset($this->cssUrl))
50
-			return $this->cssUrl;
52
+		if (isset($this->cssUrl)) {
53
+					return $this->cssUrl;
54
+		}
51 55
 		$version=$this->version;
52
-		if (array_search($version, $this->getVersions())===false)
53
-			$version=$this->getLastVersion();
56
+		if (array_search($version, $this->getVersions())===false) {
57
+					$version=$this->getLastVersion();
58
+		}
54 59
 		$theme=$this->theme;
55
-		if (array_search($theme, $this->getThemes())===false)
56
-			$theme=$this->getFirstTheme();
60
+		if (array_search($theme, $this->getThemes())===false) {
61
+					$theme=$this->getFirstTheme();
62
+		}
57 63
 		return $this->replaceVersionAndTheme($this->data [$this->provider] ["css"], $version, $theme);
58 64
 	}
59 65
 
Please login to merge, or discard this patch.
Ajax/semantic/html/content/HtmlDropdownItem.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,12 +17,15 @@  discard block
 block discarded – undo
17 17
 		parent::__construct($identifier, "a");
18 18
 		$this->setClass("item");
19 19
 		$this->setContent($content);
20
-		if($value!==NULL)
21
-			$this->setData($value);
22
-		if($image!==NULL)
23
-			$this->asMiniAvatar($image);
24
-		if($description!==NULL)
25
-			$this->setDescription($description);
20
+		if($value!==NULL) {
21
+					$this->setData($value);
22
+		}
23
+		if($image!==NULL) {
24
+					$this->asMiniAvatar($image);
25
+		}
26
+		if($description!==NULL) {
27
+					$this->setDescription($description);
28
+		}
26 29
 	}
27 30
 
28 31
 	public function setDescription($description){
@@ -39,8 +42,9 @@  discard block
 block discarded – undo
39 42
 
40 43
 	public function asOption(){
41 44
 		$this->tagName="option";
42
-		if($this->getProperty("data-value")!==null)
43
-			$this->setProperty("value", $this->getProperty("data-value"));
45
+		if($this->getProperty("data-value")!==null) {
46
+					$this->setProperty("value", $this->getProperty("data-value"));
47
+		}
44 48
 	}
45 49
 
46 50
 	/**
Please login to merge, or discard this patch.
Ajax/semantic/html/base/traits/MenuItemTrait.php 1 patch
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,14 +11,15 @@  discard block
 block discarded – undo
11 11
 	public function setContent($content){
12 12
 		if($content==="-"){
13 13
 			$this->asDivider();
14
-		}elseif($content==="-search-"){
14
+		} elseif($content==="-search-"){
15 15
 			$values=\explode(",",$content,-1);
16 16
 			$this->asSearchInput(JArray::getDefaultValue($values, 0, "Search..."),JArray::getDefaultValue($values, 1, "search"));
17
-		}elseif(JString::startswith($content, "-")){
17
+		} elseif(JString::startswith($content, "-")){
18 18
 			$content=\ltrim($content,"-");
19 19
 			$this->asHeader($content);
20
-		}else
21
-			parent::setContent($content);
20
+		} else {
21
+					parent::setContent($content);
22
+		}
22 23
 		return $this;
23 24
 	}
24 25
 
@@ -30,11 +31,13 @@  discard block
 block discarded – undo
30 31
 	public function asSearchInput($placeholder=NULL,$icon=NULL){
31 32
 		$this->setClass("ui icon search input");
32 33
 		$input=new HtmlInput("search-".$this->identifier);
33
-		if(isset($placeholder))
34
-			$input->setProperty("placeholder", $placeholder);
34
+		if(isset($placeholder)) {
35
+					$input->setProperty("placeholder", $placeholder);
36
+		}
35 37
 			$this->content=$input;
36
-			if(isset($icon))
37
-				$this->addIcon($icon);
38
+			if(isset($icon)) {
39
+							$this->addIcon($icon);
40
+			}
38 41
 				return $this;
39 42
 	}
40 43
 
@@ -57,8 +60,9 @@  discard block
 block discarded – undo
57 60
 		$this->setClass("header");
58 61
 		$this->tagName="div";
59 62
 		$this->content=$caption;
60
-		if(isset($icon))
61
-			$this->addIcon($icon,Direction::LEFT);
63
+		if(isset($icon)) {
64
+					$this->addIcon($icon,Direction::LEFT);
65
+		}
62 66
 			return $this;
63 67
 	}
64 68
 
Please login to merge, or discard this patch.
Ajax/semantic/html/collections/form/traits/TextFieldsTrait.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,9 @@
 block discarded – undo
17 17
 	}
18 18
 
19 19
 	public function setInputType($type){
20
-		if($type==="hidden")
21
-			$this->addToProperty("style","display:none;");
20
+		if($type==="hidden") {
21
+					$this->addToProperty("style","display:none;");
22
+		}
22 23
 		$this->getDataField()->setInputType($type);
23 24
 		return $this;
24 25
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/content/InternalPopup.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,9 @@
 block discarded – undo
50 50
 						$comp=$item->compile($js);
51 51
 						if(isset($js)){
52 52
 							$bs=$item->run($js);
53
-							if(isset($bs))
54
-								$this->params['onShow']=$bs->getScript();
53
+							if(isset($bs)) {
54
+															$this->params['onShow']=$bs->getScript();
55
+							}
55 56
 						}
56 57
 						$item=$comp;
57 58
 					}
Please login to merge, or discard this patch.
Ajax/common/html/traits/BaseHtmlEventsTrait.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	public function onCreate($jsCode){
53 53
 		if(isset($this->_events["_create"])){
54 54
 			$this->_events["_create"][]=$jsCode;
55
-		}else{
55
+		} else{
56 56
 			$this->_events["_create"]=[$jsCode];
57 57
 		}
58 58
 		return $this;
@@ -87,8 +87,9 @@  discard block
 block discarded – undo
87 87
 			if(\is_array($create)){
88 88
 				$create=\implode("", $create);
89 89
 			}
90
-			if(isset($js) && $create!=="")
91
-				$js->exec($create,true);
90
+			if(isset($js) && $create!=="") {
91
+							$js->exec($create,true);
92
+			}
92 93
 			unset($this->_events["_create"]);
93 94
 		}
94 95
 	}
Please login to merge, or discard this patch.
Ajax/semantic/html/elements/html5/HtmlImg.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,9 @@
 block discarded – undo
14 14
 	}
15 15
 
16 16
 	public function asAvatar($caption=NULL) {
17
-		if (isset($caption))
18
-			$this->wrap("", $caption);
17
+		if (isset($caption)) {
18
+					$this->wrap("", $caption);
19
+		}
19 20
 			return $this->addToProperty("class", "avatar");
20 21
 	}
21 22
 
Please login to merge, or discard this patch.
Ajax/semantic/html/modules/HtmlProgress.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,11 +12,13 @@  discard block
 block discarded – undo
12 12
 
13 13
 	public function __construct($identifier, $value=NULL, $label=NULL, $attributes=array()) {
14 14
 		parent::__construct($identifier, "div", "ui progress");
15
-		if (isset($value))
16
-			$this->setProperty("data-percent", $value);
15
+		if (isset($value)) {
16
+					$this->setProperty("data-percent", $value);
17
+		}
17 18
 		$this->createBar();
18
-		if (isset($label))
19
-			$this->setLabel($label);
19
+		if (isset($label)) {
20
+					$this->setLabel($label);
21
+		}
20 22
 		$this->_states=[ State::SUCCESS,State::WARNING,State::ERROR,State::ACTIVE,State::DISABLED ];
21 23
 		$this->addToProperty("class", $attributes);
22 24
 	}
@@ -111,8 +113,9 @@  discard block
 block discarded – undo
111 113
 	 * @see BaseHtml::run()
112 114
 	 */
113 115
 	public function run(JsUtils $js) {
114
-		if (isset($this->_bsComponent) === false)
115
-			$this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params);
116
+		if (isset($this->_bsComponent) === false) {
117
+					$this->_bsComponent=$js->semantic()->progress("#" . $this->identifier, $this->_params);
118
+		}
116 119
 		$this->addEventsOnRun($js);
117 120
 		return $this->_bsComponent;
118 121
 	}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/content/HtmlNavzone.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 		if (\is_array($elements)) {
62 62
 			foreach ( $elements as $key => $element ) {
63 63
 				$iid=$this->getElementsCount()+1;
64
-				if ($element instanceof HtmlDropdownItem)
65
-					$this->elements []=$element;
66
-				else if (\is_array($element)) {
64
+				if ($element instanceof HtmlDropdownItem) {
65
+									$this->elements []=$element;
66
+				} else if (\is_array($element)) {
67 67
 					if (is_string($key)===true) {
68 68
 						$dropdown=new HtmlDropdown($this->identifier."-dropdown-".$iid);
69 69
 						$dropdown->addItems($element);
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		$li=new HtmlBsDoubleElement($this->identifier."-li-".$iid, "li");
90 90
 		if($caption instanceof HtmlLink){
91 91
 			$link=$caption;
92
-		}else{
92
+		} else{
93 93
 			$link=new HtmlLink($this->identifier."-link-".$iid, $href, $caption);
94 94
 		}
95 95
 		$li->setContent($link);
Please login to merge, or discard this patch.