Passed
Push — v5.x ( 26d105...7911f3 )
by Thierry
03:11
created
src/Request/Call/Parameter.php 2 patches
Switch Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -166,29 +166,29 @@
 block discarded – undo
166 166
     {
167 167
         switch($this->getType())
168 168
         {
169
-        case self::JS_CALL:
170
-            return $this->getValue()->toArray();
171
-        case self::JS_VALUE:
172
-            return [
173
-                '_type' => 'expr',
174
-                'calls' => [['_type' => 'attr', '_name' => $this->getValue()]],
175
-            ];
176
-        case self::FORM_VALUES:
177
-            return ['_type' => 'form', '_name' => $this->getValue()];
178
-        case self::INPUT_VALUE:
179
-            return ['_type' => 'input', '_name' => $this->getValue()];
180
-        case self::CHECKED_VALUE:
181
-            return ['_type' => 'checked', '_name' => $this->getValue()];
182
-        case self::ELEMENT_INNERHTML:
183
-            return ['_type' => 'html', '_name' => $this->getValue()];
184
-        case self::QUOTED_VALUE:
185
-        case self::BOOL_VALUE:
186
-        case self::NUMERIC_VALUE:
187
-        case self::JSON_VALUE:
188
-        case self::PAGE_NUMBER:
189
-        default:
190
-            // Return the value as is.
191
-            return $this->getValue();
169
+            case self::JS_CALL:
170
+                return $this->getValue()->toArray();
171
+            case self::JS_VALUE:
172
+                return [
173
+                    '_type' => 'expr',
174
+                    'calls' => [['_type' => 'attr', '_name' => $this->getValue()]],
175
+                ];
176
+            case self::FORM_VALUES:
177
+                return ['_type' => 'form', '_name' => $this->getValue()];
178
+            case self::INPUT_VALUE:
179
+                return ['_type' => 'input', '_name' => $this->getValue()];
180
+            case self::CHECKED_VALUE:
181
+                return ['_type' => 'checked', '_name' => $this->getValue()];
182
+            case self::ELEMENT_INNERHTML:
183
+                return ['_type' => 'html', '_name' => $this->getValue()];
184
+            case self::QUOTED_VALUE:
185
+            case self::BOOL_VALUE:
186
+            case self::NUMERIC_VALUE:
187
+            case self::JSON_VALUE:
188
+            case self::PAGE_NUMBER:
189
+            default:
190
+                // Return the value as is.
191
+                return $this->getValue();
192 192
         }
193 193
     }
194 194
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -131,23 +131,23 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public static function make($xValue): ParameterInterface
133 133
     {
134
-        if($xValue instanceof ParameterInterface)
134
+        if ($xValue instanceof ParameterInterface)
135 135
         {
136 136
             return $xValue;
137 137
         }
138
-        if(is_numeric($xValue))
138
+        if (is_numeric($xValue))
139 139
         {
140 140
             return new Parameter(self::NUMERIC_VALUE, $xValue);
141 141
         }
142
-        if(is_string($xValue))
142
+        if (is_string($xValue))
143 143
         {
144 144
             return new Parameter(self::QUOTED_VALUE, $xValue);
145 145
         }
146
-        if(is_bool($xValue))
146
+        if (is_bool($xValue))
147 147
         {
148 148
             return new Parameter(self::BOOL_VALUE, $xValue);
149 149
         }
150
-        if($xValue instanceof JsCall)
150
+        if ($xValue instanceof JsCall)
151 151
         {
152 152
             return new Parameter(self::JS_CALL, $xValue);
153 153
         }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     public function forArray()
166 166
     {
167
-        switch($this->getType())
167
+        switch ($this->getType())
168 168
         {
169 169
         case self::JS_CALL:
170 170
             return $this->getValue()->toArray();
Please login to merge, or discard this patch.
src/Request/Call/Call.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -317,14 +317,14 @@  discard block
 block discarded – undo
317 317
     public function toArray(): array
318 318
     {
319 319
         $aCall = parent::toArray();
320
-        if($this->bConfirm)
320
+        if ($this->bConfirm)
321 321
         {
322 322
             $aCall['confirm'] = $this->aConfirmArgs;
323 323
         }
324
-        if(($this->aCondition))
324
+        if (($this->aCondition))
325 325
         {
326 326
             $aCall['condition'] = $this->aCondition;
327
-            if(($this->aMessageArgs))
327
+            if (($this->aMessageArgs))
328 328
             {
329 329
                 $aCall['else'] = $this->getMessage();
330 330
             }
@@ -339,9 +339,9 @@  discard block
 block discarded – undo
339 339
      */
340 340
     private function findPageNumber(): ?ParameterInterface
341 341
     {
342
-        foreach($this->aParameters as $xParameter)
342
+        foreach ($this->aParameters as $xParameter)
343 343
         {
344
-            if($xParameter->getType() === Parameter::PAGE_NUMBER)
344
+            if ($xParameter->getType() === Parameter::PAGE_NUMBER)
345 345
             {
346 346
                 return $xParameter;
347 347
             }
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
     {
371 371
         /** @var Parameter */
372 372
         $xParameter = $this->findPageNumber();
373
-        if($xParameter !== null)
373
+        if ($xParameter !== null)
374 374
         {
375 375
             $xParameter->setValue($nPageNumber);
376 376
         }
Please login to merge, or discard this patch.
src/Request/Call/JsCall.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
      */
124 124
     public function addParameters(array $aParameters): JsCall
125 125
     {
126
-        foreach($aParameters as $xParameter)
126
+        foreach ($aParameters as $xParameter)
127 127
         {
128 128
             $this->pushParameter(Parameter::make($xParameter));
129 129
         }
@@ -144,12 +144,12 @@  discard block
 block discarded – undo
144 144
                 return $xParam->forArray();
145 145
             }, $this->aParameters),
146 146
         ]];
147
-        if($this->bToInt)
147
+        if ($this->bToInt)
148 148
         {
149 149
             $aCalls[] = [
150 150
                 '_type' => 'func',
151 151
                 '_name' => 'jaxon.utils.string.toInt',
152
-                'params' => [[ '_type' => '_', '_name' => 'this' ]],
152
+                'params' => [['_type' => '_', '_name' => 'this']],
153 153
             ];
154 154
         }
155 155
         return [
Please login to merge, or discard this patch.