Passed
Push — v5.x ( afe246...87a13b )
by Thierry
02:15
created
src/Request/Js/Selector.php 1 patch
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -162,19 +162,18 @@  discard block
 block discarded – undo
162 162
     private function getPathAsStr()
163 163
     {
164 164
         $jQuery = 'jaxon.jq'; // The JQuery selector
165
-        if(!$this->sPath)
165
+        if (!$this->sPath)
166 166
         {
167 167
             // If an empty selector is given, use the event target instead
168 168
             return "$jQuery(e.currentTarget)";
169 169
         }
170
-        if(!$this->xContext)
170
+        if (!$this->xContext)
171 171
         {
172 172
             return "$jQuery('" . $this->sPath . "')";
173 173
         }
174 174
 
175 175
         $sContext = is_a($this->xContext, self::class) ?
176
-            $this->xContext->getScript() :
177
-            "$jQuery('" . trim("{$this->xContext}") . "')";
176
+            $this->xContext->getScript() : "$jQuery('" . trim("{$this->xContext}") . "')";
178 177
         return "$jQuery('{$this->sPath}', $sContext)";
179 178
     }
180 179
 
@@ -196,7 +195,7 @@  discard block
 block discarded – undo
196 195
     {
197 196
         $sName = $this->sPath ?? 'this';
198 197
         $aCall = ['_type' => 'select', '_name' => $sName];
199
-        if(($this->xContext))
198
+        if (($this->xContext))
200 199
         {
201 200
             $aCall['context'] = $this->xContext;
202 201
         }
@@ -209,16 +208,16 @@  discard block
 block discarded – undo
209 208
     public function toArray(): array
210 209
     {
211 210
         $aCalls = [$this->getPathAsArray()];
212
-        foreach($this->aCalls as $xCall)
211
+        foreach ($this->aCalls as $xCall)
213 212
         {
214 213
             $aCalls[] = $xCall->jsonSerialize();
215 214
         }
216
-        if($this->bToInt)
215
+        if ($this->bToInt)
217 216
         {
218 217
             $aCalls[] = [
219 218
                 '_type' => 'func',
220 219
                 '_name' => 'toInt',
221
-                'args' => [[ '_type' => '_', '_name' => 'this' ]],
220
+                'args' => [['_type' => '_', '_name' => 'this']],
222 221
             ];
223 222
         }
224 223
         return ['_type' => 'expr', 'calls' => $aCalls];
Please login to merge, or discard this patch.