@@ -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 |
@@ -291,8 +291,9 @@ discard block |
||
291 | 291 | */ |
292 | 292 | public function addItemInToolbar($caption, $icon = NULL, $callback = NULL) { |
293 | 293 | $result = $this->addInToolbar($caption, $callback); |
294 | - if (isset($icon) && method_exists($result, "addIcon")) |
|
295 | - $result->addIcon($icon); |
|
294 | + if (isset($icon) && method_exists($result, "addIcon")) { |
|
295 | + $result->addIcon($icon); |
|
296 | + } |
|
296 | 297 | return $result; |
297 | 298 | } |
298 | 299 | |
@@ -481,8 +482,9 @@ discard block |
||
481 | 482 | protected function _compileForm() { |
482 | 483 | if (isset($this->_form)) { |
483 | 484 | $noValidate = ""; |
484 | - if (\sizeof($this->_form->getValidationParams()) > 0) |
|
485 | - $noValidate = "novalidate"; |
|
485 | + if (\sizeof($this->_form->getValidationParams()) > 0) { |
|
486 | + $noValidate = "novalidate"; |
|
487 | + } |
|
486 | 488 | $this->wrapContent("<form class='" . $this->_form->getProperty('class') . "' id='frm-" . $this->identifier . "' name='frm-" . $this->identifier . "' " . $noValidate . ">", "</form>"); |
487 | 489 | } |
488 | 490 | } |
@@ -26,8 +26,9 @@ discard block |
||
26 | 26 | State::ERROR, |
27 | 27 | State::DISABLED |
28 | 28 | ]; |
29 | - if (isset($label) && $label !== "") |
|
30 | - $this->setLabel($label); |
|
29 | + if (isset($label) && $label !== "") { |
|
30 | + $this->setLabel($label); |
|
31 | + } |
|
31 | 32 | $this->setField($field); |
32 | 33 | $this->_validation = NULL; |
33 | 34 | } |
@@ -59,8 +60,9 @@ discard block |
||
59 | 60 | * @return mixed |
60 | 61 | */ |
61 | 62 | public function getLabel() { |
62 | - if (\array_key_exists("label", $this->content)) |
|
63 | - return $this->content["label"]; |
|
63 | + if (\array_key_exists("label", $this->content)) { |
|
64 | + return $this->content["label"]; |
|
65 | + } |
|
64 | 66 | } |
65 | 67 | |
66 | 68 | /** |
@@ -145,7 +147,7 @@ discard block |
||
145 | 147 | if($type->getType()=='empty'){ |
146 | 148 | $this->addToProperty('class', 'required'); |
147 | 149 | } |
148 | - }elseif ($type === 'empty' || ($type['type'] ?? '') === 'empty') { |
|
150 | + } elseif ($type === 'empty' || ($type['type'] ?? '') === 'empty') { |
|
149 | 151 | $this->addToProperty('class', 'required'); |
150 | 152 | } |
151 | 153 | $this->_validation->addRule($type, $prompt, $value); |