Passed
Push — main ( 238af9...5ca287 )
by Thierry
20:54 queued 15:16
created
jaxon-core/src/Di/Container.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -237,7 +237,7 @@
 block discarded – undo
237 237
      */
238 238
     public function val(string $sKey, $xValue)
239 239
     {
240
-       $this->xLibContainer->offsetSet($sKey, $xValue);
240
+        $this->xLibContainer->offsetSet($sKey, $xValue);
241 241
     }
242 242
 
243 243
     /**
Please login to merge, or discard this patch.
jaxon-core/src/Response/AbstractResponse.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -91,15 +91,15 @@
 block discarded – undo
91 91
         return $this->xManager->getErrorMessage();
92 92
     }
93 93
 
94
-     /**
95
-     * Add a response command to the array of commands
96
-     *
97
-     * @param string $sName    The command name
98
-     * @param array|JsonSerializable $aArgs    The command arguments
99
-     * @param bool $bRemoveEmpty
100
-     *
101
-     * @return Command
102
-     */
94
+        /**
95
+         * Add a response command to the array of commands
96
+         *
97
+         * @param string $sName    The command name
98
+         * @param array|JsonSerializable $aArgs    The command arguments
99
+         * @param bool $bRemoveEmpty
100
+         *
101
+         * @return Command
102
+         */
103 103
     public function addCommand(string $sName, array|JsonSerializable $aArgs = [],
104 104
         bool $bRemoveEmpty = false): Command
105 105
     {
Please login to merge, or discard this patch.
Switch Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -30,68 +30,68 @@  discard block
 block discarded – undo
30 30
 
31 31
 abstract class AbstractResponse
32 32
 {
33
-    /**
33
+/**
34 34
      * @var ResponseManager
35 35
      */
36
-    protected $xManager;
36
+protected $xManager;
37 37
 
38
-    /**
38
+/**
39 39
      * @var PluginManager
40 40
      */
41
-    protected $xPluginManager;
41
+protected $xPluginManager;
42 42
 
43
-    /**
43
+/**
44 44
      * The constructor
45 45
      *
46 46
      * @param ResponseManager $xManager
47 47
      * @param PluginManager $xPluginManager
48 48
      */
49
-    public function __construct(ResponseManager $xManager, PluginManager $xPluginManager)
50
-    {
51
-        $this->xManager = $xManager;
52
-        $this->xPluginManager = $xPluginManager;
53
-    }
49
+public function __construct(ResponseManager $xManager, PluginManager $xPluginManager)
50
+{
51
+$this->xManager = $xManager;
52
+$this->xPluginManager = $xPluginManager;
53
+}
54 54
 
55
-    /**
55
+/**
56 56
      * @inheritDoc
57 57
      */
58
-    abstract public function getContentType(): string;
58
+abstract public function getContentType(): string;
59 59
 
60
-    /**
60
+/**
61 61
      * @inheritDoc
62 62
      */
63
-    abstract public function getOutput(): string;
63
+abstract public function getOutput(): string;
64 64
 
65
-    /**
65
+/**
66 66
      * Convert this response to a PSR7 response object
67 67
      *
68 68
      * @return PsrResponseInterface
69 69
      */
70
-    abstract public function toPsr(): PsrResponseInterface;
70
+abstract public function toPsr(): PsrResponseInterface;
71 71
 
72
-    /**
72
+/**
73 73
      * Convert to string
74 74
      *
75 75
      * @param mixed $xData
76 76
      *
77 77
      * @return string
78 78
      */
79
-    protected function str($xData): string
80
-    {
81
-        return $this->xManager->str($xData);
82
-    }
79
+protected function str($xData): string
80
+{
81
+return $this->xManager->str($xData);
82
+}
83 83
 
84
-    /**
84
+/**
85 85
      * Get the error message
86 86
      *
87 87
      * @return string
88 88
      */
89
-    public function getErrorMessage(): string
90
-    {
91
-        return $this->xManager->getErrorMessage();
92
-    }
89
+public function getErrorMessage(): string
90
+{
91
+return $this->xManager->getErrorMessage();
92
+}
93 93
 
94
-     /**
94
+/**
95 95
      * Add a response command to the array of commands
96 96
      *
97 97
      * @param string $sName    The command name
@@ -100,43 +100,43 @@  discard block
 block discarded – undo
100 100
      *
101 101
      * @return Command
102 102
      */
103
-    public function addCommand(string $sName, array|JsonSerializable $aArgs = [],
104
-        bool $bRemoveEmpty = false): Command
105
-    {
106
-        return $this->xManager->addCommand($sName, $aArgs, $bRemoveEmpty);
107
-    }
103
+public function addCommand(string $sName, array|JsonSerializable $aArgs = [],
104
+bool $bRemoveEmpty = false): Command
105
+{
106
+return $this->xManager->addCommand($sName, $aArgs, $bRemoveEmpty);
107
+}
108 108
 
109
-    /**
109
+/**
110 110
      * Get the commands in the response
111 111
      *
112 112
      * @return array
113 113
      */
114
-    public function getCommands(): array
115
-    {
116
-        return $this->xManager->getCommands();
117
-    }
114
+public function getCommands(): array
115
+{
116
+return $this->xManager->getCommands();
117
+}
118 118
 
119
-    /**
119
+/**
120 120
      * Get the number of commands in the response
121 121
      *
122 122
      * @return int
123 123
      */
124
-    public function getCommandCount(): int
125
-    {
126
-        return $this->xManager->getCommandCount();
127
-    }
124
+public function getCommandCount(): int
125
+{
126
+return $this->xManager->getCommandCount();
127
+}
128 128
 
129
-    /**
129
+/**
130 130
      * Clear all the commands already added to the response
131 131
      *
132 132
      * @return void
133 133
      */
134
-    public function clearCommands(): void
135
-    {
136
-        $this->xManager->clearCommands();
137
-    }
134
+public function clearCommands(): void
135
+{
136
+$this->xManager->clearCommands();
137
+}
138 138
 
139
-    /**
139
+/**
140 140
      * Find a response plugin by name or class name
141 141
      *
142 142
      * @template R of ResponsePluginInterface
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
      *
145 145
      * @return ($sName is class-string ? R|null : ResponsePluginInterface|null)
146 146
      */
147
-    public function plugin(string $sName): ?ResponsePluginInterface
148
-    {
149
-        $xResponsePlugin = $this->xPluginManager->getResponsePlugin($sName);
150
-        return !$xResponsePlugin ? null : $xResponsePlugin->initPlugin($this);
151
-    }
147
+public function plugin(string $sName): ?ResponsePluginInterface
148
+{
149
+$xResponsePlugin = $this->xPluginManager->getResponsePlugin($sName);
150
+return !$xResponsePlugin ? null : $xResponsePlugin->initPlugin($this);
151
+}
152 152
 
153
-    /**
153
+/**
154 154
      * Magic PHP function
155 155
      *
156 156
      * Used to permit plugins to be called as if they were native members of the Response instance.
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
      *
160 160
      * @return null|ResponsePluginInterface
161 161
      */
162
-    public function __get(string $sPluginName)
163
-    {
164
-        return $this->plugin($sPluginName);
165
-    }
162
+public function __get(string $sPluginName)
163
+{
164
+return $this->plugin($sPluginName);
165
+}
166 166
 }
Please login to merge, or discard this patch.
jaxon-core/src/App/View/Helper/HtmlAttrHelper.php 1 patch
Switch Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -203,12 +203,12 @@
 block discarded – undo
203 203
         $sCode = match($sType) {
204 204
             'html' => jaxon()->package($sClass)?->getHtml() ?? '',
205 205
             'ready' => jaxon()->package($sClass)?->getReadyScript() ?? '',
206
-            default => ''
207
-        };
208
-        $sCode = trim($sCode);
206
+default => ''
207
+};
208
+$sCode = trim($sCode);
209 209
 
210
-        return $sType !== 'ready' || $sCode === '' ? $sCode :
211
-            // Call the ready code with the jaxon.dom.ready function.
212
-            "jaxon.dom.ready(() => $sCode)";
213
-    }
210
+return $sType !== 'ready' || $sCode === '' ? $sCode :
211
+// Call the ready code with the jaxon.dom.ready function.
212
+"jaxon.dom.ready(() => $sCode)";
213
+}
214 214
 }
Please login to merge, or discard this patch.
jaxon-core/src/App/PageComponent.php 1 patch
Switch Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -6,53 +6,53 @@
 block discarded – undo
6 6
 
7 7
 abstract class PageComponent extends NodeComponent
8 8
 {
9
-    /**
9
+/**
10 10
      * The current page number.
11 11
      *
12 12
      * @var int
13 13
      */
14
-    private int $currentPage = 1;
14
+private int $currentPage = 1;
15 15
 
16
-    /**
16
+/**
17 17
      * Get the total number of items to paginate.
18 18
      *
19 19
      * @return int
20 20
      */
21
-    abstract protected function count(): int;
21
+abstract protected function count(): int;
22 22
 
23
-    /**
23
+/**
24 24
      * Get the max number of items per page.
25 25
      *
26 26
      * @return int
27 27
      */
28
-    abstract protected function limit(): int;
28
+abstract protected function limit(): int;
29 29
 
30
-    /**
30
+/**
31 31
      * Get the paginator for the component.
32 32
      *
33 33
      * @param int $pageNumber
34 34
      *
35 35
      * @return Paginator
36 36
      */
37
-    protected function paginator(int $pageNumber): Paginator
38
-    {
39
-        return $this->cl(Component\Pagination::class)
40
-            // Use the js class name as component item identifier.
41
-            ->item($this->rq()->_class())
42
-            ->paginator($pageNumber > 0 ? $pageNumber : 1, $this->limit(), $this->count())
43
-            // This callback will receive the final value of the current page number.
44
-            ->page(function(int $currentPage) {
45
-                $this->currentPage = $currentPage;
46
-            });
47
-    }
37
+protected function paginator(int $pageNumber): Paginator
38
+{
39
+return $this->cl(Component\Pagination::class)
40
+// Use the js class name as component item identifier.
41
+->item($this->rq()->_class())
42
+->paginator($pageNumber > 0 ? $pageNumber : 1, $this->limit(), $this->count())
43
+// This callback will receive the final value of the current page number.
44
+->page(function(int $currentPage) {
45
+    $this->currentPage = $currentPage;
46
+});
47
+}
48 48
 
49
-    /**
49
+/**
50 50
      * Get the current page number
51 51
      *
52 52
      * @return int
53 53
      */
54
-    protected function currentPage(): int
55
-    {
56
-        return $this->currentPage;
57
-    }
54
+protected function currentPage(): int
55
+{
56
+return $this->currentPage;
57
+}
58 58
 }
Please login to merge, or discard this patch.
jaxon-core/src/App/PageDatabagTrait.php 1 patch
Switch Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -6,81 +6,81 @@
 block discarded – undo
6 6
 
7 7
 trait PageDatabagTrait
8 8
 {
9
-    /**
9
+/**
10 10
      * The current page number.
11 11
      *
12 12
      * @var int
13 13
      */
14
-    private int $currentPage = 1;
14
+private int $currentPage = 1;
15 15
 
16
-    /**
16
+/**
17 17
      * Get the pagination databag name.
18 18
      *
19 19
      * @return string
20 20
      */
21
-    abstract protected function bagName(): string;
21
+abstract protected function bagName(): string;
22 22
 
23
-    /**
23
+/**
24 24
      * Get the pagination databag attribute.
25 25
      *
26 26
      * @return string
27 27
      */
28
-    abstract protected function bagAttr(): string;
28
+abstract protected function bagAttr(): string;
29 29
 
30
-    /**
30
+/**
31 31
      * Get the page number.
32 32
      *
33 33
      * @param int $pageNumber
34 34
      *
35 35
      * @return int
36 36
      */
37
-    private function getPageNumber(int $pageNumber): int
38
-    {
39
-        // If no page number is provided, then get the value from the databag.
40
-        return $pageNumber > 0 ? $pageNumber :
41
-            (int)$this->bag($this->bagName())->get($this->bagAttr(), 1);
42
-    }
37
+private function getPageNumber(int $pageNumber): int
38
+{
39
+// If no page number is provided, then get the value from the databag.
40
+return $pageNumber > 0 ? $pageNumber :
41
+(int)$this->bag($this->bagName())->get($this->bagAttr(), 1);
42
+}
43 43
 
44
-    /**
44
+/**
45 45
      * Set the page number.
46 46
      *
47 47
      * @param int $currentPage
48 48
      *
49 49
      * @return void
50 50
      */
51
-    private function setCurrentPage(int $currentPage): void
52
-    {
53
-        // Save the current page in the databag.
54
-        $this->bag($this->bagName())->set($this->bagAttr(), $currentPage);
55
-        $this->currentPage = $currentPage;
56
-    }
51
+private function setCurrentPage(int $currentPage): void
52
+{
53
+// Save the current page in the databag.
54
+$this->bag($this->bagName())->set($this->bagAttr(), $currentPage);
55
+$this->currentPage = $currentPage;
56
+}
57 57
 
58
-    /**
58
+/**
59 59
      * Get the paginator for the component.
60 60
      *
61 61
      * @param int $pageNumber
62 62
      *
63 63
      * @return Paginator
64 64
      */
65
-    protected function paginator(int $pageNumber): Paginator
66
-    {
67
-        return $this->cl(Component\Pagination::class)
68
-            // Use the js class name as component item identifier.
69
-            ->item($this->rq()->_class())
70
-            ->paginator($this->getPageNumber($pageNumber), $this->limit(), $this->count())
71
-            // This callback will receive the final value of the current page number.
72
-            ->page(function(int $currentPage) {
73
-                $this->setCurrentPage($currentPage);
74
-            });
75
-    }
65
+protected function paginator(int $pageNumber): Paginator
66
+{
67
+return $this->cl(Component\Pagination::class)
68
+// Use the js class name as component item identifier.
69
+->item($this->rq()->_class())
70
+->paginator($this->getPageNumber($pageNumber), $this->limit(), $this->count())
71
+// This callback will receive the final value of the current page number.
72
+->page(function(int $currentPage) {
73
+    $this->setCurrentPage($currentPage);
74
+});
75
+}
76 76
 
77
-    /**
77
+/**
78 78
      * Get the current page number
79 79
      *
80 80
      * @return int
81 81
      */
82
-    protected function currentPage(): int
83
-    {
84
-        return $this->currentPage;
85
-    }
82
+protected function currentPage(): int
83
+{
84
+return $this->currentPage;
85
+}
86 86
 }
Please login to merge, or discard this patch.
jaxon-core/src/jaxon_ns.php 1 patch
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  */
31 31
 function jaxon(): JaxonLib
32 32
 {
33
-    return JaxonLib::getInstance();
33
+return JaxonLib::getInstance();
34 34
 }
35 35
 
36 36
 /**
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
  */
45 45
 function cl(string $sClassName): mixed
46 46
 {
47
-    return jaxon()->cdi()->makeComponent($sClassName);
47
+return jaxon()->cdi()->makeComponent($sClassName);
48 48
 }
49 49
 
50 50
 /**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
  */
57 57
 function rq(string $sClassName = ''): JxnCall
58 58
 {
59
-    return jaxon()->di()->getCallFactory()->rq($sClassName);
59
+return jaxon()->di()->getCallFactory()->rq($sClassName);
60 60
 }
61 61
 
62 62
 /**
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
  */
69 69
 function jo(string $sJsObject = ''): JsObjectCall
70 70
 {
71
-    return jaxon()->di()->getCallFactory()->jo($sJsObject);
71
+return jaxon()->di()->getCallFactory()->jo($sJsObject);
72 72
 }
73 73
 
74 74
 /**
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
  */
82 82
 function jq(string $sPath = '', $xContext = null): JqSelectorCall
83 83
 {
84
-    return jaxon()->di()->getCallFactory()->jq($sPath, $xContext);
84
+return jaxon()->di()->getCallFactory()->jq($sPath, $xContext);
85 85
 }
86 86
 
87 87
 /**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
  */
94 94
 function je(string $sElementId = ''): JsSelectorCall
95 95
 {
96
-    return jaxon()->di()->getCallFactory()->je($sElementId);
96
+return jaxon()->di()->getCallFactory()->je($sElementId);
97 97
 }
98 98
 
99 99
 /**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function attr(): HtmlAttrHelper
105 105
 {
106
-    return jaxon()->di()->getHtmlAttrHelper();
106
+return jaxon()->di()->getHtmlAttrHelper();
107 107
 }
108 108
 
109 109
 /**
@@ -114,5 +114,5 @@  discard block
 block discarded – undo
114 114
  */
115 115
 function pm(): ParameterFactory
116 116
 {
117
-    return jaxon()->di()->getParameterFactory();
117
+return jaxon()->di()->getParameterFactory();
118 118
 }
Please login to merge, or discard this patch.
jaxon-core/src/jaxon_fn.php 1 patch
Switch Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,5 +21,5 @@
 block discarded – undo
21 21
  */
22 22
 function jaxon(): Jaxon
23 23
 {
24
-    return Jaxon::getInstance();
24
+return Jaxon::getInstance();
25 25
 }
Please login to merge, or discard this patch.
jaxon-core/src/Exception/Exception.php 1 patch
Switch Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 
17 17
 class Exception extends \Exception
18 18
 {
19
-    public function __construct(string $sMessage)
20
-    {
21
-        parent::__construct($sMessage);
22
-    }
19
+public function __construct(string $sMessage)
20
+{
21
+parent::__construct($sMessage);
22
+}
23 23
 }
Please login to merge, or discard this patch.
jaxon-core/src/globals.php 1 patch
Switch Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function cl(string $sClassName): mixed
34 34
 {
35
-    return \Jaxon\cl($sClassName);
35
+return \Jaxon\cl($sClassName);
36 36
 }
37 37
 
38 38
 /**
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
  */
45 45
 function rq(string $sClassName = ''): JxnCall
46 46
 {
47
-    return \Jaxon\rq($sClassName);
47
+return \Jaxon\rq($sClassName);
48 48
 }
49 49
 
50 50
 /**
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
  */
57 57
 function jo(string $sJsObject = ''): JsObjectCall
58 58
 {
59
-    return \Jaxon\jo($sJsObject);
59
+return \Jaxon\jo($sJsObject);
60 60
 }
61 61
 
62 62
 /**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
  */
70 70
 function jq(string $sPath = '', $xContext = null): JqSelectorCall
71 71
 {
72
-    return \Jaxon\jq($sPath, $xContext);
72
+return \Jaxon\jq($sPath, $xContext);
73 73
 }
74 74
 
75 75
 /**
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
  */
82 82
 function je(string $sElementId = ''): JsSelectorCall
83 83
 {
84
-    return \Jaxon\je($sElementId);
84
+return \Jaxon\je($sElementId);
85 85
 }
86 86
 
87 87
 /**
@@ -91,5 +91,5 @@  discard block
 block discarded – undo
91 91
  */
92 92
 function attr(): HtmlAttrHelper
93 93
 {
94
-    return \Jaxon\attr();
94
+return \Jaxon\attr();
95 95
 }
Please login to merge, or discard this patch.