Passed
Push — master ( 71a1f0...84bf4a )
by Jean-Christophe
03:31 queued 19s
created
Ajax/semantic/html/elements/HtmlButtonGroups.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
 	protected $_dropdown;
19 19
 	public function __construct($identifier, $elements=array(), $asIcons=false) {
20 20
 		parent::__construct($identifier, "div", "ui buttons");
21
-		if ($asIcons === true)
21
+		if ($asIcons===true)
22 22
 			$this->asIcons();
23 23
 		$this->addElements($elements, $asIcons);
24 24
 	}
25
-	protected function createItem($value){
25
+	protected function createItem($value) {
26 26
 		return new HtmlButton("", $value);
27 27
 	}
28 28
 
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 	 * @param boolean $asCombo
32 32
 	 * @return HtmlDropdown
33 33
 	 */
34
-	public function addDropdown($items,$asCombo=false){
35
-		$dd= new HtmlDropdown("dd-".$this->identifier,null,$items);
34
+	public function addDropdown($items, $asCombo=false) {
35
+		$dd=new HtmlDropdown("dd-".$this->identifier, null, $items);
36 36
 		$dd->asButton();
37
-		if($asCombo){
37
+		if ($asCombo) {
38 38
 			$dd->setAction("combo");
39 39
 			$dd->addToProperty("class", "combo");
40 40
 		}
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public function addElement($element, $asIcon=false) {
52 52
 		$item=$this->addItem($element);
53
-		if($asIcon)
53
+		if ($asIcon)
54 54
 			$item->asIcon($element);
55 55
 		return $item;
56 56
 	}
57 57
 
58 58
 	public function addElements($elements, $asIcons=false) {
59
-		foreach ( $elements as $element ) {
59
+		foreach ($elements as $element) {
60 60
 			$this->addElement($element, $asIcons);
61 61
 		}
62 62
 		return $this;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	public function insertOr($aferIndex=0, $or="or") {
66 66
 		$orElement=new HtmlSemDoubleElement("", "div", "or");
67 67
 		$orElement->setProperty("data-text", $or);
68
-		array_splice($this->content, $aferIndex + 1, 0, array ($orElement ));
68
+		array_splice($this->content, $aferIndex+1, 0, array($orElement));
69 69
 		return $this;
70 70
 	}
71 71
 
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 	}
79 79
 
80 80
 	public function asIcons() {
81
-		foreach ( $this->content as $item ) {
82
-			if($item instanceof HtmlButton)
81
+		foreach ($this->content as $item) {
82
+			if ($item instanceof HtmlButton)
83 83
 			$item->asIcon($item->getContent());
84 84
 		}
85 85
 		return $this->addToProperty("class", "icons");
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 	 * @param array $icons
91 91
 	 * @return HtmlButtonGroups
92 92
 	 */
93
-	public function addIcons($icons){
94
-		foreach ( $this->content as $index=>$item ) {
95
-			if($item instanceof HtmlButton && isset($icons[$index]))
93
+	public function addIcons($icons) {
94
+		foreach ($this->content as $index=>$item) {
95
+			if ($item instanceof HtmlButton && isset($icons[$index]))
96 96
 				$item->addIcon($icons[$index]);
97 97
 		}
98 98
 		return $this;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 * @see \Ajax\bootstrap\html\base\BaseHtml::on()
126 126
 	 */
127 127
 	public function on($event, $jsCode, $stopPropagation=false, $preventDefault=false) {
128
-		foreach ( $this->content as $element ) {
128
+		foreach ($this->content as $element) {
129 129
 			$element->on($event, $jsCode, $stopPropagation, $preventDefault);
130 130
 		}
131 131
 		return $this;
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
 
138 138
 	public function addClasses($classes=array()) {
139 139
 		$i=0;
140
-		if(!\is_array($classes)){
141
-			$classes=array_fill (0,$this->count(),$classes);
140
+		if (!\is_array($classes)) {
141
+			$classes=array_fill(0, $this->count(), $classes);
142 142
 		}
143
-		foreach ( $this->content as $button ) {
143
+		foreach ($this->content as $button) {
144 144
 			$button->addToProperty("class", $classes[$i++]);
145 145
 		}
146 146
 		return $this;
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
 		$this->addElement($function($object));
155 155
 	}
156 156
 
157
-	public function run(JsUtils $js){
158
-		$result= parent::run($js);
157
+	public function run(JsUtils $js) {
158
+		$result=parent::run($js);
159 159
 		return $result->setItemSelector(".ui.button");
160 160
 	}
161 161
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,8 +18,9 @@  discard block
 block discarded – undo
18 18
 	protected $_dropdown;
19 19
 	public function __construct($identifier, $elements=array(), $asIcons=false) {
20 20
 		parent::__construct($identifier, "div", "ui buttons");
21
-		if ($asIcons === true)
22
-			$this->asIcons();
21
+		if ($asIcons === true) {
22
+					$this->asIcons();
23
+		}
23 24
 		$this->addElements($elements, $asIcons);
24 25
 	}
25 26
 	protected function createItem($value){
@@ -50,8 +51,9 @@  discard block
 block discarded – undo
50 51
 	 */
51 52
 	public function addElement($element, $asIcon=false) {
52 53
 		$item=$this->addItem($element);
53
-		if($asIcon)
54
-			$item->asIcon($element);
54
+		if($asIcon) {
55
+					$item->asIcon($element);
56
+		}
55 57
 		return $item;
56 58
 	}
57 59
 
@@ -79,8 +81,9 @@  discard block
 block discarded – undo
79 81
 
80 82
 	public function asIcons() {
81 83
 		foreach ( $this->content as $item ) {
82
-			if($item instanceof HtmlButton)
83
-			$item->asIcon($item->getContent());
84
+			if($item instanceof HtmlButton) {
85
+						$item->asIcon($item->getContent());
86
+			}
84 87
 		}
85 88
 		return $this->addToProperty("class", "icons");
86 89
 	}
@@ -92,8 +95,9 @@  discard block
 block discarded – undo
92 95
 	 */
93 96
 	public function addIcons($icons){
94 97
 		foreach ( $this->content as $index=>$item ) {
95
-			if($item instanceof HtmlButton && isset($icons[$index]))
96
-				$item->addIcon($icons[$index]);
98
+			if($item instanceof HtmlButton && isset($icons[$index])) {
99
+							$item->addIcon($icons[$index]);
100
+			}
97 101
 		}
98 102
 		return $this;
99 103
 	}
Please login to merge, or discard this patch.