@@ -161,10 +161,11 @@ discard block |
||
161 | 161 | } elseif (isset($this->ajaxTransition)) { |
162 | 162 | $call = $this->ajaxTransition; |
163 | 163 | } |
164 | - if (\is_callable($call)) |
|
165 | - $retour = "\t" . $call($responseElement, $jqueryDone) . ";\n"; |
|
166 | - else |
|
167 | - $retour = "\t{$responseElement}.{$jqueryDone}( data );\n"; |
|
164 | + if (\is_callable($call)) { |
|
165 | + $retour = "\t" . $call($responseElement, $jqueryDone) . ";\n"; |
|
166 | + } else { |
|
167 | + $retour = "\t{$responseElement}.{$jqueryDone}( data );\n"; |
|
168 | + } |
|
168 | 169 | } |
169 | 170 | if (isset($history)) { |
170 | 171 | if ($this->params["autoActiveLinks"]) { |
@@ -198,8 +199,9 @@ discard block |
||
198 | 199 | } |
199 | 200 | |
200 | 201 | protected function _correctAjaxUrl($url) { |
201 | - if ($url !== "/" && JString::endsWith($url, "/") === true) |
|
202 | - $url = substr($url, 0, strlen($url) - 1); |
|
202 | + if ($url !== "/" && JString::endsWith($url, "/") === true) { |
|
203 | + $url = substr($url, 0, strlen($url) - 1); |
|
204 | + } |
|
203 | 205 | if (strncmp($url, 'http://', 7) != 0 && strncmp($url, 'https://', 8) != 0) { |
204 | 206 | $url = $this->getUrl($url); |
205 | 207 | } |
@@ -223,8 +225,9 @@ discard block |
||
223 | 225 | public static function _implodeParams($parameters) { |
224 | 226 | $allParameters = []; |
225 | 227 | foreach ($parameters as $params) { |
226 | - if (isset($params)) |
|
227 | - $allParameters[] = self::_correctParams($params); |
|
228 | + if (isset($params)) { |
|
229 | + $allParameters[] = self::_correctParams($params); |
|
230 | + } |
|
228 | 231 | } |
229 | 232 | return \implode("+'&'+", $allParameters); |
230 | 233 | } |
@@ -258,8 +261,9 @@ discard block |
||
258 | 261 | |
259 | 262 | protected function setDefaultParameters(&$parameters, $default) { |
260 | 263 | foreach ($default as $k => $v) { |
261 | - if (! isset($parameters[$k])) |
|
262 | - $parameters[$k] = $v; |
|
264 | + if (! isset($parameters[$k])) { |
|
265 | + $parameters[$k] = $v; |
|
266 | + } |
|
263 | 267 | } |
264 | 268 | } |
265 | 269 | |
@@ -833,8 +837,9 @@ discard block |
||
833 | 837 | $retour .= "$('#'+" . $form . ").submit();\n"; |
834 | 838 | } |
835 | 839 | $retour = $this->_addJsCondition($jsCondition, $retour); |
836 | - if ($immediatly) |
|
837 | - $this->jquery_code_for_compile[] = $retour; |
|
840 | + if ($immediatly) { |
|
841 | + $this->jquery_code_for_compile[] = $retour; |
|
842 | + } |
|
838 | 843 | return $retour; |
839 | 844 | } |
840 | 845 |
@@ -14,16 +14,18 @@ |
||
14 | 14 | const TOGGLE_INTERVAL = 2; |
15 | 15 | |
16 | 16 | public function __construct($identifier, $label = NULL, $type = "text", $value = NULL, $placeholder = NULL) { |
17 | - if (! isset($placeholder) && $type === "text") |
|
18 | - $placeholder = $label; |
|
17 | + if (! isset($placeholder) && $type === "text") { |
|
18 | + $placeholder = $label; |
|
19 | + } |
|
19 | 20 | parent::__construct("field-" . $identifier, new HtmlInput($identifier, $type, $value, $placeholder), $label); |
20 | 21 | $this->_identifier = $identifier; |
21 | 22 | } |
22 | 23 | |
23 | 24 | public function getDataField() { |
24 | 25 | $field = $this->getField(); |
25 | - if ($field instanceof HtmlInput) |
|
26 | - $field = $field->getDataField(); |
|
26 | + if ($field instanceof HtmlInput) { |
|
27 | + $field = $field->getDataField(); |
|
28 | + } |
|
27 | 29 | return $field; |
28 | 30 | } |
29 | 31 |
@@ -112,15 +112,18 @@ discard block |
||
112 | 112 | $flag = false; |
113 | 113 | $index = 0; |
114 | 114 | while (! $flag && $index < sizeof($elements)) { |
115 | - if ($elements[$index] instanceof BaseHtml) |
|
116 | - $flag = ($callback($elements[$index])); |
|
115 | + if ($elements[$index] instanceof BaseHtml) { |
|
116 | + $flag = ($callback($elements[$index])); |
|
117 | + } |
|
117 | 118 | $index ++; |
118 | 119 | } |
119 | - if ($flag === true) |
|
120 | - return $elements[$index - 1]; |
|
120 | + if ($flag === true) { |
|
121 | + return $elements[$index - 1]; |
|
122 | + } |
|
121 | 123 | } elseif ($elements instanceof BaseHtml) { |
122 | - if ($callback($elements)) |
|
123 | - return $elements; |
|
124 | + if ($callback($elements)) { |
|
125 | + return $elements; |
|
126 | + } |
|
124 | 127 | } |
125 | 128 | return null; |
126 | 129 | } |
@@ -146,8 +149,9 @@ discard block |
||
146 | 149 | |
147 | 150 | public function fromArray($array) { |
148 | 151 | foreach ($this as $key => $value) { |
149 | - if (array_key_exists($key, $array) === true) |
|
150 | - $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
152 | + if (array_key_exists($key, $array) === true) { |
|
153 | + $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
154 | + } |
|
151 | 155 | } |
152 | 156 | foreach ($array as $key => $value) { |
153 | 157 | if ($this->_callSetter($key, $key, $value, $array) === false) { |
@@ -19,8 +19,9 @@ discard block |
||
19 | 19 | * @param mixed $view |
20 | 20 | */ |
21 | 21 | protected function _compileLibrary(BaseGui $library, &$view = NULL) { |
22 | - if (isset($view)) |
|
23 | - $library->compileHtml($this, $view); |
|
22 | + if (isset($view)) { |
|
23 | + $library->compileHtml($this, $view); |
|
24 | + } |
|
24 | 25 | if ($library->isAutoCompile()) { |
25 | 26 | $library->compile(true); |
26 | 27 | } |
@@ -39,8 +40,9 @@ discard block |
||
39 | 40 | } |
40 | 41 | |
41 | 42 | protected function minify($input) { |
42 | - if (trim($input) === "") |
|
43 | - return $input; |
|
43 | + if (trim($input) === "") { |
|
44 | + return $input; |
|
45 | + } |
|
44 | 46 | $input = preg_replace(array( |
45 | 47 | // Remove comment(s) |
46 | 48 | '#\s*("(?:[^"\\\]++|\\\.)*+"|\'(?:[^\'\\\\]++|\\\.)*+\')\s*|\s*\/\*(?!\!|@cc_on)(?>[\s\S]*?\*\/)\s*|\s*(?<![\:\=])\/\/.*(?=[\n\r]|$)|^\s*|\s*$#', |
@@ -59,10 +59,12 @@ discard block |
||
59 | 59 | #[\ReturnTypeWillChange] |
60 | 60 | public function jsonSerialize() { |
61 | 61 | $result= ["type"=>$this->type]; |
62 | - if(isset($this->prompt)) |
|
63 | - $result["prompt"]=$this->prompt; |
|
64 | - if(isset($this->value)) |
|
65 | - $result["value"]=$this->value; |
|
62 | + if(isset($this->prompt)) { |
|
63 | + $result["prompt"]=$this->prompt; |
|
64 | + } |
|
65 | + if(isset($this->value)) { |
|
66 | + $result["value"]=$this->value; |
|
67 | + } |
|
66 | 68 | return $result; |
67 | 69 | } |
68 | 70 | |
@@ -94,8 +96,9 @@ discard block |
||
94 | 96 | * @return \Ajax\semantic\components\validation\Rule |
95 | 97 | */ |
96 | 98 | public static function integer($min=NULL,$max=NULL,$prompt=NULL){ |
97 | - if(\is_int($min) && \is_int($max)) |
|
98 | - return new Rule("integer[{$min}..{$max}]",$prompt); |
|
99 | + if(\is_int($min) && \is_int($max)) { |
|
100 | + return new Rule("integer[{$min}..{$max}]",$prompt); |
|
101 | + } |
|
99 | 102 | return new Rule("integer",$prompt); |
100 | 103 | } |
101 | 104 |