Completed
Push — master ( 3e8704...4367a8 )
by Jean-Christophe
03:21
created
Ajax/bootstrap/html/HtmlInputgroup.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
 		$span->setTagName("div");
71 71
 		$buttons=array();
72 72
 		$i=1;
73
-		foreach ($items as $item){
73
+		foreach ($items as $item) {
74 74
 			$bt=NULL;
75
-			if(is_string($item)){
76
-				$bt=new HtmlButton($this->identifier."-bt-".$i++,$item);
77
-			}elseif ($item instanceof HtmlButton){
75
+			if (is_string($item)) {
76
+				$bt=new HtmlButton($this->identifier."-bt-".$i++, $item);
77
+			}elseif ($item instanceof HtmlButton) {
78 78
 				$bt=$item;
79 79
 			}
80
-			if(isset($bt)){
80
+			if (isset($bt)) {
81 81
 				$buttons[]=$bt;
82 82
 			}
83 83
 		}
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function setSize($size) {
121 121
 		if (is_int($size)) {
122
-			return $this->addToMemberCtrl($this->mClass, CssRef::sizes("input-group")[$size],CssRef::sizes("input-group"));
122
+			return $this->addToMemberCtrl($this->mClass, CssRef::sizes("input-group")[$size], CssRef::sizes("input-group"));
123 123
 		}
124 124
 		return $this->addToMemberCtrl($this->mClass, $size, CssRef::sizes("input-group"));
125 125
 	}
Please login to merge, or discard this patch.
Braces   +17 added lines, -13 removed lines patch added patch discarded remove patch
@@ -28,10 +28,11 @@  discard block
 block discarded – undo
28 28
 		$this->setProperty("aria-describedby", $id);
29 29
 		$span->setContent($text);
30 30
 		$span->setClass("input-group-addon");
31
-		if (strtolower($position)==="left")
32
-			$this->addonLeft=$span;
33
-		else
34
-			$this->addonRight=$span;
31
+		if (strtolower($position)==="left") {
32
+					$this->addonLeft=$span;
33
+		} else {
34
+					$this->addonRight=$span;
35
+		}
35 36
 		return $span;
36 37
 	}
37 38
 
@@ -74,7 +75,7 @@  discard block
 block discarded – undo
74 75
 			$bt=NULL;
75 76
 			if(is_string($item)){
76 77
 				$bt=new HtmlButton($this->identifier."-bt-".$i++,$item);
77
-			}elseif ($item instanceof HtmlButton){
78
+			} elseif ($item instanceof HtmlButton){
78 79
 				$bt=$item;
79 80
 			}
80 81
 			if(isset($bt)){
@@ -88,10 +89,11 @@  discard block
 block discarded – undo
88 89
 		$dropdown->setBtnCaption($caption);
89 90
 		$dropdown->fromArray($items);
90 91
 
91
-		if (strtolower($position)==="left")
92
-			$this->addonLeft=$dropdown;
93
-		else
94
-			$this->addonRight=$dropdown;
92
+		if (strtolower($position)==="left") {
93
+					$this->addonLeft=$dropdown;
94
+		} else {
95
+					$this->addonRight=$dropdown;
96
+		}
95 97
 		return $dropdown;
96 98
 	}
97 99
 
@@ -126,10 +128,12 @@  discard block
 block discarded – undo
126 128
 
127 129
 	public function run(JsUtils $js) {
128 130
 		parent::run($js);
129
-		if (isset($this->addonLeft))
130
-			$this->addonLeft->run($js);
131
-		if (isset($this->addonRight))
132
-			$this->addonRight->run($js);
131
+		if (isset($this->addonLeft)) {
132
+					$this->addonLeft->run($js);
133
+		}
134
+		if (isset($this->addonRight)) {
135
+					$this->addonRight->run($js);
136
+		}
133 137
 	}
134 138
 
135 139
 }
136 140
\ No newline at end of file
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlListgroup.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 	public function __construct($identifier, $tagName="ul") {
17 17
 		parent::__construct($identifier, $tagName);
18
-		$this->content=array ();
18
+		$this->content=array();
19 19
 		$this->_template='<%tagName% %properties%>%content%</%tagName%>';
20 20
 		$this->setProperty("class", "list-group");
21 21
 	}
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 	public function addItem($text="") {
24 24
 		if (is_object($text)) {
25 25
 			$element=$text;
26
-		} else {
27
-			switch($this->tagName) {
26
+		}else {
27
+			switch ($this->tagName) {
28 28
 				case "ul":
29 29
 					$element=new HtmlDoubleElement("list-gi-".$this->identifier);
30 30
 					$element->setTagName("li");
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 	}
46 46
 
47 47
 	public function addItems($items) {
48
-		foreach ( $items as $item ) {
48
+		foreach ($items as $item) {
49 49
 			if (is_string($item)) {
50 50
 				$this->addItem($item);
51
-			} else
51
+			}else
52 52
 				$this->content []=$item;
53 53
 		}
54 54
 	}
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,14 +48,16 @@
 block discarded – undo
48 48
 		foreach ( $items as $item ) {
49 49
 			if (is_string($item)) {
50 50
 				$this->addItem($item);
51
-			} else
52
-				$this->content []=$item;
51
+			} else {
52
+							$this->content []=$item;
53
+			}
53 54
 		}
54 55
 	}
55 56
 
56 57
 	public function getItem($index) {
57
-		if ($index<sizeof($this->content))
58
-			return $this->content [$index];
58
+		if ($index<sizeof($this->content)) {
59
+					return $this->content [$index];
60
+		}
59 61
 	}
60 62
 
61 63
 	/* (non-PHPdoc)
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlNavbar.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	public function __construct($identifier, $brand="Brand", $brandHref="#") {
33 33
 		parent::__construct($identifier);
34 34
 		$this->_template=include 'templates/tplNavbar.php';
35
-		$this->navZones=array ();
35
+		$this->navZones=array();
36 36
 		$this->class="navbar-default";
37 37
 		$this->brand=$brand;
38 38
 		$this->brandHref=$brandHref;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	}
61 61
 
62 62
 	public function setBrandImage($imageSrc) {
63
-		$this->brandImage=PhalconUtils::image(array (
63
+		$this->brandImage=PhalconUtils::image(array(
64 64
 				$imageSrc,
65 65
 				"alt" => $this->brand
66 66
 		));
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 
108 108
 	public function setNavZones($navZones) {
109 109
 		if (is_array($navZones)) {
110
-			foreach ( $navZones as $zoneType => $zoneArray ) {
110
+			foreach ($navZones as $zoneType => $zoneArray) {
111 111
 				if (is_string($zoneType)) {
112 112
 					$zone=$this->addZone($zoneType);
113 113
 					$zone->fromArray($zoneArray);
114
-				} else if (is_string($zoneArray))
114
+				}else if (is_string($zoneArray))
115 115
 					$this->addElement($zoneArray);
116 116
 				else
117 117
 					$this->addElements($zoneArray);
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
 		if (is_int($index)) {
147 147
 			if ($index<$nb)
148 148
 				$zone=$this->navZones [$index];
149
-		} else {
150
-			for($i=0; $i<$nb; $i++) {
149
+		}else {
150
+			for ($i=0; $i<$nb; $i++) {
151 151
 				if ($this->navZones [$i]->getIdentifier()===$index) {
152 152
 					$zone=$this->navZones [$i];
153 153
 					break;
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	}
159 159
 
160 160
 	public function run(JsUtils $js) {
161
-		foreach ( $this->navZones as $zone ) {
161
+		foreach ($this->navZones as $zone) {
162 162
 			$zone->run($js);
163 163
 		}
164 164
 		if ($this->hasScrollspy) {
@@ -180,9 +180,9 @@  discard block
 block discarded – undo
180 180
 	}
181 181
 
182 182
 	public function setFluid($fluid) {
183
-		if($fluid===true){
183
+		if ($fluid===true) {
184 184
 			$this->fluid="container-fluid";
185
-		}else{
185
+		}else {
186 186
 			$this->fluid="container";
187 187
 		}
188 188
 		return $this;
Please login to merge, or discard this patch.
Braces   +17 added lines, -13 removed lines patch added patch discarded remove patch
@@ -86,8 +86,9 @@  discard block
 block discarded – undo
86 86
 
87 87
 	public function addElement($element, HtmlNavzone $zone=NULL) {
88 88
 		$zone=$this->getZoneToInsertIn($zone);
89
-		if ($element instanceof HtmlDropdown)
90
-			$element->setMTagName("li");
89
+		if ($element instanceof HtmlDropdown) {
90
+					$element->setMTagName("li");
91
+		}
91 92
 		$zone->addElement($element);
92 93
 	}
93 94
 
@@ -111,10 +112,11 @@  discard block
 block discarded – undo
111 112
 				if (is_string($zoneType)) {
112 113
 					$zone=$this->addZone($zoneType);
113 114
 					$zone->fromArray($zoneArray);
114
-				} else if (is_string($zoneArray))
115
-					$this->addElement($zoneArray);
116
-				else
117
-					$this->addElements($zoneArray);
115
+				} else if (is_string($zoneArray)) {
116
+									$this->addElement($zoneArray);
117
+				} else {
118
+									$this->addElements($zoneArray);
119
+				}
118 120
 			}
119 121
 		}
120 122
 	}
@@ -127,10 +129,11 @@  discard block
 block discarded – undo
127 129
 	public function getZoneToInsertIn($zone=NULL) {
128 130
 		if (!isset($zone)) {
129 131
 			$nb=sizeof($this->navZones);
130
-			if ($nb<1)
131
-				$zone=$this->addZone();
132
-			else
133
-				$zone=$this->navZones [$nb-1];
132
+			if ($nb<1) {
133
+							$zone=$this->addZone();
134
+			} else {
135
+							$zone=$this->navZones [$nb-1];
136
+			}
134 137
 		}
135 138
 		return $zone;
136 139
 	}
@@ -144,8 +147,9 @@  discard block
 block discarded – undo
144 147
 		$zone=null;
145 148
 		$nb=sizeof($this->navZones);
146 149
 		if (is_int($index)) {
147
-			if ($index<$nb)
148
-				$zone=$this->navZones [$index];
150
+			if ($index<$nb) {
151
+							$zone=$this->navZones [$index];
152
+			}
149 153
 		} else {
150 154
 			for($i=0; $i<$nb; $i++) {
151 155
 				if ($this->navZones [$i]->getIdentifier()===$index) {
@@ -182,7 +186,7 @@  discard block
 block discarded – undo
182 186
 	public function setFluid($fluid) {
183 187
 		if($fluid===true){
184 188
 			$this->fluid="container-fluid";
185
-		}else{
189
+		} else{
186 190
 			$this->fluid="container";
187 191
 		}
188 192
 		return $this;
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlSplitbutton.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 	 */
43 43
 	public function run(JsUtils $js) {
44 44
 		if ($this->getProperty("role")==="nav") {
45
-			foreach ( $this->items as $dropdownItem ) {
45
+			foreach ($this->items as $dropdownItem) {
46 46
 				$dropdownItem->runNav($js);
47 47
 			}
48 48
 		}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/base/CssRef.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	const CSS_DEFAULT="-default", CSS_PRIMARY="-primary", CSS_SUCCESS="-success", CSS_INFO="-info", CSS_WARNING="-warning", CSS_DANGER="-danger", CSS_LINK="-link";
15 15
 
16 16
 	public static function buttonStyles() {
17
-		return array (
17
+		return array(
18 18
 				"btn-default",
19 19
 				"btn-primary",
20 20
 				"btn-success",
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	}
27 27
 
28 28
 	public static function Styles($prefix="btn") {
29
-		return array (
29
+		return array(
30 30
 				$prefix."-default",
31 31
 				$prefix."-primary",
32 32
 				$prefix."-success",
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 
39 39
 	public static function sizes($prefix="btn") {
40
-		return array (
40
+		return array(
41 41
 				$prefix."-lg",
42 42
 				"",
43 43
 				$prefix."-sm",
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	}
47 47
 
48 48
 	public static function position() {
49
-		return array (
49
+		return array(
50 50
 				"top",
51 51
 				"left",
52 52
 				"right",
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	public static function alignment($prefix="") {
59
-		return array (
59
+		return array(
60 60
 				$prefix."",
61 61
 				$prefix."left",
62 62
 				$prefix."right",
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	}
67 67
 
68 68
 	public static function navbarZoneClasses() {
69
-		return array (
69
+		return array(
70 70
 				"navbar-nav",
71 71
 				"navbar-left",
72 72
 				"navbar-right",
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	}
76 76
 
77 77
 	public static function glyphIcons() {
78
-		return array (
78
+		return array(
79 79
 				"glyphicon-asterisk",
80 80
 				"glyphicon-plus",
81 81
 				"glyphicon-euro",
@@ -347,9 +347,9 @@  discard block
 block discarded – undo
347 347
 	public static function getStyle($cssStyle, $prefix) {
348 348
 		if (is_int($cssStyle)) {
349 349
 			$styles=CssRef::Styles($prefix);
350
-			if ($cssStyle<sizeof($styles)&&$cssStyle>=0) {
350
+			if ($cssStyle<sizeof($styles) && $cssStyle>=0) {
351 351
 				return CssRef::styles($prefix)[$cssStyle];
352
-			} else {
352
+			}else {
353 353
 				throw new \Exception("La valeur passée a propriété `Style` ne fait pas partie des valeurs possibles : index '".$cssStyle."' inexistant");
354 354
 			}
355 355
 		}
Please login to merge, or discard this patch.
Ajax/bootstrap/html/base/HtmlElementAsContent.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@
 block discarded – undo
26 26
 	}
27 27
 
28 28
 	public function addBadge($caption, $leftSeparator="&nbsp;") {
29
-		return $this->element->addBadge($caption,$leftSeparator);
29
+		return $this->element->addBadge($caption, $leftSeparator);
30 30
 	}
31 31
 
32 32
 	public function addLabel($caption, $style="label-default", $leftSeparator="&nbsp;") {
33
-		return $this->element->addLabel($caption,$style,$leftSeparator);
33
+		return $this->element->addLabel($caption, $style, $leftSeparator);
34 34
 	}
35 35
 
36 36
 	public function run(JsUtils $js) {
Please login to merge, or discard this patch.
Ajax/bootstrap/html/content/HtmlDropdownItem.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
 		$glyph->setGlyphicon($glyphicon);
150 150
 		if ($left) {
151 151
 			$this->content=$glyph->compile().$separator.$this->content;
152
-		} else {
152
+		}else {
153 153
 			$this->content.=$separator.$glyph->compile();
154 154
 		}
155 155
 		return $this;
Please login to merge, or discard this patch.
Ajax/bootstrap/html/content/HtmlListgroupItem.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 		$element=new HtmlDoubleElement("", "p");
72 72
 		$element->setContent($content);
73 73
 		$element->setClass("list-group-item-text");
74
-		$this->element->setContent(array (
74
+		$this->element->setContent(array(
75 75
 				$elementHeader,
76 76
 				$element
77 77
 		));
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@
 block discarded – undo
40 40
 	 * @return \Ajax\bootstrap\html\HtmlListgroupItem default : "list-group-item-default"
41 41
 	 */
42 42
 	public function setStyle($cssStyle) {
43
-		if (!PhalconUtils::startsWith($cssStyle, "list-group-item"))
44
-			$cssStyle="list-group-item".$cssStyle;
43
+		if (!PhalconUtils::startsWith($cssStyle, "list-group-item")) {
44
+					$cssStyle="list-group-item".$cssStyle;
45
+		}
45 46
 		$this->element->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("list-group-item"));
46 47
 		return $this->element;
47 48
 	}
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,6 +18,9 @@  discard block
 block discarded – undo
18 18
  */
19 19
 class HtmlListgroupItem extends HtmlElementAsContent {
20 20
 
21
+	/**
22
+	 * @param HtmlBsDoubleElement $element
23
+	 */
21 24
 	public function __construct($element) {
22 25
 		parent::__construct($element);
23 26
 		$this->element->setProperty("class", "list-group-item");
@@ -37,7 +40,7 @@  discard block
 block discarded – undo
37 40
 	 * define the Panel style
38 41
 	 * avaible values : "list-group-item-default","list-group-item-primary","list-group-item-success","list-group-item-info","list-group-item-warning","list-group-item-danger"
39 42
 	 * @param string|int $cssStyle
40
-	 * @return \Ajax\bootstrap\html\HtmlListgroupItem default : "list-group-item-default"
43
+	 * @return \Ajax\common\html\HtmlSingleElement default : "list-group-item-default"
41 44
 	 */
42 45
 	public function setStyle($cssStyle) {
43 46
 		if (!PhalconUtils::startsWith($cssStyle, "list-group-item"))
Please login to merge, or discard this patch.
Ajax/bootstrap/html/content/HtmlNavzone.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		parent::__construct($identifier);
28 28
 		$this->tagName="ul";
29 29
 		$this->_template='<%tagName% class="nav navbar-nav %class%">%elements%</%tagName%>';
30
-		$this->elements=array ();
30
+		$this->elements=array();
31 31
 	}
32 32
 
33 33
 	public function setClass($value) {
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
 	}
36 36
 
37 37
 	public function addElement($element) {
38
-		if($element instanceof HtmlLink){
38
+		if ($element instanceof HtmlLink) {
39 39
 			$this->addLink($element);
40
-		} else if (is_object($element)) {
40
+		}else if (is_object($element)) {
41 41
 			$this->elements []=$element;
42
-		} else if (is_array($element)) {
42
+		}else if (is_array($element)) {
43 43
 			$this->addLink(array_pop($element), array_pop($element));
44
-		} else {
44
+		}else {
45 45
 			$this->addLink($element);
46 46
 		}
47 47
 	}
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
 	public function addElements($elements) {
57 57
 		if (is_array($elements)) {
58
-			foreach ( $elements as $key => $element ) {
58
+			foreach ($elements as $key => $element) {
59 59
 				$iid=$this->getElementsCount()+1;
60 60
 				if ($element instanceof HtmlDropdownItem)
61 61
 					$this->elements []=$element;
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
 						$dropdown->setBtnCaption($key);
67 67
 						$dropdown->setMTagName("li");
68 68
 						$this->addElement($dropdown);
69
-					} else {
69
+					}else {
70 70
 						$this->addLink(array_pop($element), array_pop($element));
71 71
 					}
72
-				} else if (is_object($element)) {
72
+				}else if (is_object($element)) {
73 73
 					$this->addElement($element);
74
-				} else if (is_string($element)) {
74
+				}else if (is_string($element)) {
75 75
 					$this->addLink($element);
76 76
 				}
77 77
 				// TODO A vérifier
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
 	public function addLink($caption, $href="#") {
84 84
 		$iid=$this->getElementsCount()+1;
85 85
 		$li=new HtmlDoubleElement($this->identifier."-li-".$iid, "li");
86
-		if($caption instanceof HtmlLink){
86
+		if ($caption instanceof HtmlLink) {
87 87
 			$link=$caption;
88
-		}else{
88
+		}else {
89 89
 			$link=new HtmlLink($this->identifier."-link-".$iid, $href, $caption);
90 90
 		}
91 91
 		$li->setContent($link);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	}
114 114
 
115 115
 	public function run(JsUtils $js) {
116
-		foreach ( $this->elements as $element ) {
116
+		foreach ($this->elements as $element) {
117 117
 			$element->run($js);
118 118
 		}
119 119
 	}
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	 * @param int $index
135 135
 	 * @return BaseHtml
136 136
 	 */
137
-	public function getElement($index){
137
+	public function getElement($index) {
138 138
 		return $this->elements[$index];
139 139
 	}
140 140
 }
141 141
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
 		if (is_array($elements)) {
58 58
 			foreach ( $elements as $key => $element ) {
59 59
 				$iid=$this->getElementsCount()+1;
60
-				if ($element instanceof HtmlDropdownItem)
61
-					$this->elements []=$element;
62
-				else if (is_array($element)) {
60
+				if ($element instanceof HtmlDropdownItem) {
61
+									$this->elements []=$element;
62
+				} else if (is_array($element)) {
63 63
 					if (is_string($key)===true) {
64 64
 						$dropdown=new HtmlDropdown($this->identifier."-dropdown-".$iid);
65 65
 						$dropdown->addItems($element);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		$li=new HtmlDoubleElement($this->identifier."-li-".$iid, "li");
86 86
 		if($caption instanceof HtmlLink){
87 87
 			$link=$caption;
88
-		}else{
88
+		} else{
89 89
 			$link=new HtmlLink($this->identifier."-link-".$iid, $href, $caption);
90 90
 		}
91 91
 		$li->setContent($link);
Please login to merge, or discard this patch.