Passed
Push — v5.x ( 080647...00e299 )
by Thierry
02:31
created
src/Response/Traits/HtmlDomTrait.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@
 block discarded – undo
17 17
 
18 18
 trait HtmlDomTrait
19 19
 {
20
-     /**
21
-     * Add a response command to the array of commands that will be sent to the browser
22
-     *
23
-     * @param string $sName    The command name
24
-     * @param array|JsonSerializable $aOptions    The command options
25
-     *
26
-     * @return ResponseInterface
27
-     */
20
+        /**
21
+         * Add a response command to the array of commands that will be sent to the browser
22
+         *
23
+         * @param string $sName    The command name
24
+         * @param array|JsonSerializable $aOptions    The command options
25
+         *
26
+         * @return ResponseInterface
27
+         */
28 28
     abstract public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface;
29 29
 
30 30
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      *
26 26
      * @return ResponseInterface
27 27
      */
28
-    abstract public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface;
28
+    abstract public function addCommand(string $sName, array | JsonSerializable $aOptions): ResponseInterface;
29 29
 
30 30
     /**
31 31
      * Add a command to assign the specified value to the given element's attribute
Please login to merge, or discard this patch.
src/Response/Traits/CommandTrait.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@  discard block
 block discarded – undo
61 61
     public function appendCommands(array $aCommands, bool $bBefore = false)
62 62
     {
63 63
         $this->aCommands = ($bBefore) ?
64
-            array_merge($aCommands, $this->aCommands) :
65
-            array_merge($this->aCommands, $aCommands);
64
+            array_merge($aCommands, $this->aCommands) : array_merge($this->aCommands, $aCommands);
66 65
     }
67 66
 
68 67
     /**
@@ -86,7 +85,7 @@  discard block
 block discarded – undo
86 85
      *
87 86
      * @return ResponseInterface
88 87
      */
89
-    public function addCommand(string $sName, array|JsonSerializable $aOptions): ResponseInterface
88
+    public function addCommand(string $sName, array | JsonSerializable $aOptions): ResponseInterface
90 89
     {
91 90
         $this->aCommands[] = [
92 91
             'cmd' => $this->str($sName),
@@ -105,7 +104,7 @@  discard block
 block discarded – undo
105 104
      * @return ResponseInterface
106 105
      */
107 106
     public function addPluginCommand(ResponsePlugin $xPlugin, string $sName,
108
-        array|JsonSerializable $aOptions): ResponseInterface
107
+        array | JsonSerializable $aOptions): ResponseInterface
109 108
     {
110 109
         $this->aCommands[] = [
111 110
             'cmd' => $this->str($sName),
@@ -124,7 +123,7 @@  discard block
 block discarded – undo
124 123
      */
125 124
     protected function str($xData): string
126 125
     {
127
-        return trim((string)$xData, " \t\n");
126
+        return trim((string) $xData, " \t\n");
128 127
     }
129 128
 
130 129
     /**
@@ -136,10 +135,10 @@  discard block
 block discarded – undo
136 135
      *
137 136
      * @return ResponseInterface
138 137
      */
139
-    protected function _addCommand(string $sName, array|JsonSerializable $aOptions,
138
+    protected function _addCommand(string $sName, array | JsonSerializable $aOptions,
140 139
         bool $bRemoveEmpty = false): ResponseInterface
141 140
     {
142
-        if($bRemoveEmpty)
141
+        if ($bRemoveEmpty)
143 142
         {
144 143
             $aOptions = array_filter($aOptions, function($xOption) {
145 144
                 return $xOption === '';
Please login to merge, or discard this patch.
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.