Completed
Push — master ( 889f13...dc03e4 )
by Jean-Christophe
03:39
created
Ajax/semantic/html/base/traits/BaseTrait.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
 use Ajax\semantic\html\elements\HtmlIcon;
9 9
 
10 10
 trait BaseTrait {
11
-	protected $_variations=[ ];
12
-	protected $_states=[ ];
11
+	protected $_variations=[];
12
+	protected $_states=[];
13 13
 	protected $_baseClass;
14 14
 
15 15
 	protected abstract function setPropertyCtrl($name, $value, $typeCtrl);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		$this->setProperty("class", $this->_baseClass);
38 38
 		if (\is_string($variations))
39 39
 			$variations=\explode(" ", $variations);
40
-		foreach ( $variations as $variation ) {
40
+		foreach ($variations as $variation) {
41 41
 			$this->addVariation($variation);
42 42
 		}
43 43
 		return $this;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	public function addVariations($variations=array()) {
52 52
 		if (\is_string($variations))
53 53
 			$variations=\explode(" ", $variations);
54
-		foreach ( $variations as $variation ) {
54
+		foreach ($variations as $variation) {
55 55
 			$this->addVariation($variation);
56 56
 		}
57 57
 		return $this;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	public function addStates($states=array()) {
61 61
 		if (\is_string($states))
62 62
 			$states=\explode(" ", $states);
63
-		foreach ( $states as $state ) {
63
+		foreach ($states as $state) {
64 64
 			$this->addState($state);
65 65
 		}
66 66
 		return $this;
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
 		$this->setProperty("class", $this->_baseClass);
71 71
 		if (\is_string($states))
72 72
 			$states=\explode(" ", $states);
73
-		foreach ( $states as $state ) {
73
+		foreach ($states as $state) {
74 74
 			$this->addState($state);
75 75
 		}
76 76
 		return $this;
77 77
 	}
78 78
 
79 79
 	public function addIcon($icon, $before=true) {
80
-		return $this->addContent(new HtmlIcon("icon-" . $this->identifier, $icon), $before);
80
+		return $this->addContent(new HtmlIcon("icon-".$this->identifier, $icon), $before);
81 81
 	}
82 82
 
83 83
 	/**
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 *
120 120
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
121 121
 	 */
122
-	public function asHeader(){
122
+	public function asHeader() {
123 123
 		return $this->addToProperty("class", "header");
124 124
 	}
125 125
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 * show it is currently the active user selection
128 128
 	 * @return \Ajax\semantic\html\base\HtmlSemDoubleElement
129 129
 	 */
130
-	public function setActive($value=true){
130
+	public function setActive($value=true) {
131 131
 		return $this->addToProperty("class", "active");
132 132
 	}
133 133
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	}
144 144
 
145 145
 	public function setFloated($direction="right") {
146
-		return $this->addToPropertyCtrl("class", $direction . " floated", Direction::getConstantValues("floated"));
146
+		return $this->addToPropertyCtrl("class", $direction." floated", Direction::getConstantValues("floated"));
147 147
 	}
148 148
 
149 149
 	public function floatRight() {
Please login to merge, or discard this patch.
Ajax/bootstrap/html/HtmlForm.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
 	public function __construct($identifier) {
16 16
 		parent::__construct($identifier, "form");
17 17
 		$this->_template='<form id="%identifier%" name="%identifier%" %properties%>%content%</form>';
18
-		$this->futureElements=array ();
19
-		$this->formGroups=array ();
18
+		$this->futureElements=array();
19
+		$this->formGroups=array();
20 20
 	}
21 21
 
22 22
 	/*
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 	public function compile(JsUtils $js=NULL, &$view=NULL) {
27 27
 		if (isset($js)) {
28 28
 			$this->formElementsPrefix=$js->config()->getVar("formElementsPrefix");
29
-			foreach ( $this->futureElements as $futureElement ) {
29
+			foreach ($this->futureElements as $futureElement) {
30 30
 				$futureElementValue=$this->getPrefix($futureElement);
31 31
 				$futureElementValues=explode("_", $futureElementValue);
32
-				switch($futureElementValues [0]) {
32
+				switch ($futureElementValues [0]) {
33 33
 					case "input":
34 34
 						$control=new HtmlInput($futureElement);
35 35
 						$control->setClass("form-control");
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 						$control->setLabel($label, false);
48 48
 						break;
49 49
 					case "select":
50
-						$control=new HtmlSelect($futureElement,"");
50
+						$control=new HtmlSelect($futureElement, "");
51 51
 						$control->setProperty("size", $futureElementValues [1]);
52 52
 						$control->setClass("form-control");
53 53
 						//$control->setLabel($this->getPart($futureElement));
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 				$this->addElement($control);
63 63
 			}
64 64
 		}
65
-		foreach ( $this->formGroups as $group ) {
65
+		foreach ($this->formGroups as $group) {
66 66
 			$this->addContent($group);
67 67
 		}
68 68
 		return parent::compile($js, $view);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 	private function getPrefix($element) {
92 92
 		$result="input_text";
93
-		foreach ( $this->formElementsPrefix as $k => $v ) {
93
+		foreach ($this->formElementsPrefix as $k => $v) {
94 94
 			if (Text::startsWith($element, $k)) {
95 95
 				$result=$v;
96 96
 				break;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
 	public function getElement($name) {
122 122
 		$element=null;
123
-		foreach ( $this->formGroups as $group ) {
123
+		foreach ($this->formGroups as $group) {
124 124
 		}
125 125
 		return $element;
126 126
 	}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	 * @see \Ajax\bootstrap\html\base\HtmlSingleElement::fromArray()
131 131
 	 */
132 132
 	public function fromArray($array) {
133
-		foreach ( $array as $value ) {
133
+		foreach ($array as $value) {
134 134
 			if (is_string($value)) {
135 135
 				$this->futureElements []=$value;
136 136
 			}
Please login to merge, or discard this patch.