Passed
Push — v5.x ( 00e299...57c2ac )
by Thierry
11:16
created
src/Response/Traits/ScriptTrait.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,14 +20,14 @@
 block discarded – undo
20 20
 
21 21
 trait ScriptTrait
22 22
 {
23
-     /**
24
-     * Add a response command to the array of commands that will be sent to the browser
25
-     *
26
-     * @param string $sName    The command name
27
-     * @param array|JsonSerializable $aOptions    The command options
28
-     *
29
-     * @return ResponseInterface
30
-     */
23
+        /**
24
+         * Add a response command to the array of commands that will be sent to the browser
25
+         *
26
+         * @param string $sName    The command name
27
+         * @param array|JsonSerializable $aOptions    The command options
28
+         *
29
+         * @return ResponseInterface
30
+         */
31 31
     abstract public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface;
32 32
 
33 33
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      *
29 29
      * @return ResponseInterface
30 30
      */
31
-    abstract public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface;
31
+    abstract public function addCommand(string $sName, array | JsonSerializable $aOptions): ResponseInterface;
32 32
 
33 33
     /**
34 34
      * Response command that prompts user with [ok] [cancel] style message box
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $aArgs = func_get_args();
62 62
         array_shift($aArgs);
63
-        return $this->addCommand('script.call', ['func' => $this->str($sFunc),'args' => $aArgs]);
63
+        return $this->addCommand('script.call', ['func' => $this->str($sFunc), 'args' => $aArgs]);
64 64
     }
65 65
 
66 66
     /**
Please login to merge, or discard this patch.
src/Response/ResponseInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
      * @return ResponseInterface
74 74
      */
75 75
     public function addPluginCommand(ResponsePlugin $xPlugin, string $sName,
76
-        array|JsonSerializable $aOptions): ResponseInterface;
76
+        array | JsonSerializable $aOptions): ResponseInterface;
77 77
 
78 78
     /**
79 79
      * Convert this response to a PSR7 response object
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->jsonSerialize();
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.
src/Plugin/Response/JQuery/JQueryPlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
     public function selector(string $sPath = '', $xContext = null): DomSelector
76 76
     {
77 77
         $xSelector = new DomSelector($sPath, $xContext);
78
-        if($this->bCommand && $this->response() !== null)
78
+        if ($this->bCommand && $this->response() !== null)
79 79
         {
80 80
             $this->addCommand('jquery.call', ['selector' => $xSelector]);
81 81
         }
Please login to merge, or discard this patch.
src/Plugin/Response/DataBag/DataBagPlugin.php 1 patch
Spacing   +4 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     private function initDataBag()
41 41
     {
42
-        if($this->xDataBag !== null)
42
+        if ($this->xDataBag !== null)
43 43
         {
44 44
             return;
45 45
         }
@@ -48,8 +48,7 @@  discard block
 block discarded – undo
48 48
         $aBody = $xRequest->getParsedBody();
49 49
         $aParams = $xRequest->getQueryParams();
50 50
         $aData = is_array($aBody) ?
51
-            $this->readData($aBody['jxnbags'] ?? []) :
52
-            $this->readData($aParams['jxnbags'] ?? []);
51
+            $this->readData($aBody['jxnbags'] ?? []) : $this->readData($aParams['jxnbags'] ?? []);
53 52
         $this->xDataBag = new DataBag($aData);
54 53
     }
55 54
 
@@ -70,8 +69,7 @@  discard block
 block discarded – undo
70 69
     {
71 70
         // Todo: clean input data.
72 71
         return is_string($xData) ?
73
-            (json_decode($xData, true) ?: []) :
74
-            (is_array($xData) ? $xData : []);
72
+            (json_decode($xData, true) ?: []) : (is_array($xData) ? $xData : []);
75 73
     }
76 74
 
77 75
     /**
@@ -89,7 +87,7 @@  discard block
 block discarded – undo
89 87
     public function writeCommand()
90 88
     {
91 89
         $this->initDataBag();
92
-        if($this->xDataBag->touched())
90
+        if ($this->xDataBag->touched())
93 91
         {
94 92
             $this->addCommand('databag.set', ['values' => $this->xDataBag]);
95 93
         }
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
@@ -331,15 +331,15 @@  discard block
 block discarded – undo
331 331
     public function toArray(): array
332 332
     {
333 333
         $aCall = parent::toArray();
334
-        if(($this->aConfirm))
334
+        if (($this->aConfirm))
335 335
         {
336 336
             $aCall['confirm'] = $this->aConfirm;
337 337
         }
338
-        if(($this->aCondition))
338
+        if (($this->aCondition))
339 339
         {
340 340
             $aCall['condition'] = $this->aCondition;
341 341
         }
342
-        if(($this->aMessage))
342
+        if (($this->aMessage))
343 343
         {
344 344
             $aCall['else'] = $this->aMessage;
345 345
         }
@@ -353,9 +353,9 @@  discard block
 block discarded – undo
353 353
      */
354 354
     private function findPageNumber(): ?ParameterInterface
355 355
     {
356
-        foreach($this->aParameters as $xParameter)
356
+        foreach ($this->aParameters as $xParameter)
357 357
         {
358
-            if($xParameter->getType() === Parameter::PAGE_NUMBER)
358
+            if ($xParameter->getType() === Parameter::PAGE_NUMBER)
359 359
             {
360 360
                 return $xParameter;
361 361
             }
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
     {
385 385
         /** @var Parameter */
386 386
         $xParameter = $this->findPageNumber();
387
-        if($xParameter !== null)
387
+        if ($xParameter !== null)
388 388
         {
389 389
             $xParameter->setValue($nPageNumber);
390 390
         }
Please login to merge, or discard this patch.
src/App/Dialog/Library/AlertLibrary.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@  discard block
 block discarded – undo
44 44
      */
45 45
     public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string
46 46
     {
47
-        return empty($sNoScript) ? 'if(confirm(' . $sQuestion . ')){' . $sYesScript . ';}' :
48
-            'if(confirm(' . $sQuestion . ')){' . $sYesScript . ';}else{' . $sNoScript . ';}';
47
+        return empty($sNoScript) ? 'if(confirm(' . $sQuestion . ')){' . $sYesScript . ';}' : 'if(confirm(' . $sQuestion . ')){' . $sYesScript . ';}else{' . $sNoScript . ';}';
49 48
     }
50 49
 
51 50
     /**
@@ -53,7 +52,7 @@  discard block
 block discarded – undo
53 52
      */
54 53
     protected function alert(string $sMessage, string $sTitle, string $sType)
55 54
     {
56
-        if(!empty($sTitle))
55
+        if (!empty($sTitle))
57 56
         {
58 57
             $sMessage = '<b>' . $sTitle . '</b><br/>' . $sMessage;
59 58
         }
Please login to merge, or discard this patch.