Passed
Branch main (c6b105)
by Thierry
17:41
created
jaxon-core/src/App/Metadata/Data/ContainerData.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     protected function validateAttr(string $sAttr): void
52 52
     {
53
-        if(preg_match('/^[a-zA-Z][a-zA-Z0-9_]*$/', $sAttr) > 0)
53
+        if (preg_match('/^[a-zA-Z][a-zA-Z0-9_]*$/', $sAttr) > 0)
54 54
         {
55 55
             return;
56 56
         }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     protected function validateClass(string $sClass): void
66 66
     {
67
-        if(preg_match('/^(\\\)?([a-zA-Z][a-zA-Z0-9_]*)(\\\[a-zA-Z][a-zA-Z0-9_]*)*$/', $sClass) > 0)
67
+        if (preg_match('/^(\\\)?([a-zA-Z][a-zA-Z0-9_]*)(\\\[a-zA-Z][a-zA-Z0-9_]*)*$/', $sClass) > 0)
68 68
         {
69 69
             return;
70 70
         }
Please login to merge, or discard this patch.
jaxon-core/src/App/Metadata/Data/UploadData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
      */
52 52
     protected function validateField(string $sField): void
53 53
     {
54
-        if(preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sField) > 0)
54
+        if (preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sField) > 0)
55 55
         {
56 56
             return;
57 57
         }
Please login to merge, or discard this patch.
jaxon-core/src/App/Metadata/Data/HookData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
      */
54 54
     protected function validateMethod(string $sMethod): void
55 55
     {
56
-        if(preg_match('/^[a-zA-Z][a-zA-Z0-9_]*$/', $sMethod) > 0)
56
+        if (preg_match('/^[a-zA-Z][a-zA-Z0-9_]*$/', $sMethod) > 0)
57 57
         {
58 58
             return;
59 59
         }
Please login to merge, or discard this patch.
jaxon-core/src/App/Metadata/Data/DataBagData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
      */
51 51
     protected function validateName(string $sName): void
52 52
     {
53
-        if(preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sName) > 0)
53
+        if (preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sName) > 0)
54 54
         {
55 55
             return;
56 56
         }
Please login to merge, or discard this patch.
jaxon-core/src/App/Metadata/Data/CallbackData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
      */
51 51
     protected function validateObjectName(string $sName): void
52 52
     {
53
-        if(preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sName) > 0)
53
+        if (preg_match('/^[a-zA-Z][a-zA-Z0-9_\-\.]*$/', $sName) > 0)
54 54
         {
55 55
             return;
56 56
         }
Please login to merge, or discard this patch.
jaxon-core/src/App/Dialog/Manager/DialogCommand.php 1 patch
Spacing   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -113,8 +113,7 @@  discard block
 block discarded – undo
113 113
     private function alert(string $sType, string $sMessage, array $aArgs): array
114 114
     {
115 115
         return [
116
-            'lib' => $this->getLibrary() ?:
117
-                ($this->xRegistry?->getAlertLibrary()->getName() ?? ''),
116
+            'lib' => $this->getLibrary() ?: ($this->xRegistry?->getAlertLibrary()->getName() ?? ''),
118 117
             'message' => [
119 118
                 'type' => $sType,
120 119
                 'title' => $this->getTitle(),
@@ -197,8 +196,7 @@  discard block
 block discarded – undo
197 196
     public function show(string $sTitle, string $sContent, array $aButtons, array $aOptions = []): array
198 197
     {
199 198
         return [
200
-            'lib' => $this->getLibrary() ?:
201
-                ($this->xRegistry?->getModalLibrary()->getName() ?? ''),
199
+            'lib' => $this->getLibrary() ?: ($this->xRegistry?->getModalLibrary()->getName() ?? ''),
202 200
             'dialog' => [
203 201
                 'title' => $sTitle,
204 202
                 'content' => $sContent,
@@ -216,8 +214,7 @@  discard block
 block discarded – undo
216 214
     public function hide(): array
217 215
     {
218 216
         return [
219
-            'lib' => $this->getLibrary() ?:
220
-                ($this->xRegistry?->getModalLibrary()->getName() ?? ''),
217
+            'lib' => $this->getLibrary() ?: ($this->xRegistry?->getModalLibrary()->getName() ?? ''),
221 218
         ];
222 219
     }
223 220
 
@@ -232,8 +229,7 @@  discard block
 block discarded – undo
232 229
     public function confirm(string $sQuestion, array $aArgs = []): array
233 230
     {
234 231
         return [
235
-            'lib' => $this->getLibrary() ?:
236
-                ($this->xRegistry?->getConfirmLibrary()->getName() ?? ''),
232
+            'lib' => $this->getLibrary() ?: ($this->xRegistry?->getConfirmLibrary()->getName() ?? ''),
237 233
             'question' => [
238 234
                 'title' => $this->getTitle(),
239 235
                 'phrase' => $this->phrase($sQuestion, $aArgs),
Please login to merge, or discard this patch.
jaxon-core/src/App/Pagination/Paginator.php 1 patch
Spacing   +17 added lines, -20 removed lines patch added patch discarded remove patch
@@ -128,9 +128,8 @@  discard block
 block discarded – undo
128 128
      */
129 129
     private function updatePagesCount(): Paginator
130 130
     {
131
-        $this->nPagesCount = ($this->nItemsPerPage === 0 ? 0 :
132
-            (int)ceil($this->nItemsCount / $this->nItemsPerPage));
133
-        if($this->nPageNumber > $this->nPagesCount)
131
+        $this->nPagesCount = ($this->nItemsPerPage === 0 ? 0 : (int)ceil($this->nItemsCount / $this->nItemsPerPage));
132
+        if ($this->nPageNumber > $this->nPagesCount)
134 133
         {
135 134
             $this->nPageNumber = $this->nPagesCount;
136 135
         }
@@ -184,8 +183,7 @@  discard block
 block discarded – undo
184 183
     protected function getPrevPage(): Page
185 184
     {
186 185
         return $this->nPageNumber <= 1 ?
187
-            new Page('disabled', $this->sPreviousText, 0) :
188
-            new Page('enabled', $this->sPreviousText, $this->nPageNumber - 1);
186
+            new Page('disabled', $this->sPreviousText, 0) : new Page('enabled', $this->sPreviousText, $this->nPageNumber - 1);
189 187
     }
190 188
 
191 189
     /**
@@ -196,8 +194,7 @@  discard block
 block discarded – undo
196 194
     protected function getNextPage(): Page
197 195
     {
198 196
         return $this->nPageNumber >= $this->nPagesCount ?
199
-            new Page('disabled', $this->sNextText, 0) :
200
-            new Page('enabled', $this->sNextText, $this->nPageNumber + 1);
197
+            new Page('disabled', $this->sNextText, 0) : new Page('enabled', $this->sNextText, $this->nPageNumber + 1);
201 198
     }
202 199
 
203 200
     /**
@@ -209,7 +206,7 @@  discard block
 block discarded – undo
209 206
      */
210 207
     protected function getPage(int $nNumber): Page
211 208
     {
212
-        if($nNumber < 1)
209
+        if ($nNumber < 1)
213 210
         {
214 211
             return new Page('disabled', $this->sEllipsysText, 0);
215 212
         }
@@ -228,9 +225,9 @@  discard block
 block discarded – undo
228 225
     {
229 226
         $aPageNumbers = [];
230 227
 
231
-        if($this->nPagesCount <= $this->nMaxPages)
228
+        if ($this->nPagesCount <= $this->nMaxPages)
232 229
         {
233
-            for($i = 0; $i < $this->nPagesCount; $i++)
230
+            for ($i = 0; $i < $this->nPagesCount; $i++)
234 231
             {
235 232
                 $aPageNumbers[] = $i + 1;
236 233
             }
@@ -243,7 +240,7 @@  discard block
 block discarded – undo
243 240
 
244 241
         $nSlidingStart = 1;
245 242
         $nSlidingEndOffset = $nNumAdjacents + 3 - $this->nPageNumber;
246
-        if($nSlidingEndOffset < 0)
243
+        if ($nSlidingEndOffset < 0)
247 244
         {
248 245
             $nSlidingStart = $this->nPageNumber - $nNumAdjacents;
249 246
             $nSlidingEndOffset = 0;
@@ -251,23 +248,23 @@  discard block
 block discarded – undo
251 248
 
252 249
         $nSlidingEnd = $this->nPagesCount;
253 250
         $nSlidingStartOffset = $this->nPageNumber + $nNumAdjacents + 2 - $this->nPagesCount;
254
-        if($nSlidingStartOffset < 0)
251
+        if ($nSlidingStartOffset < 0)
255 252
         {
256 253
             $nSlidingEnd = $this->nPageNumber + $nNumAdjacents;
257 254
             $nSlidingStartOffset = 0;
258 255
         }
259 256
 
260 257
         // Build the list of page numbers.
261
-        if($nSlidingStart > 1)
258
+        if ($nSlidingStart > 1)
262 259
         {
263 260
             $aPageNumbers[] = 1;
264 261
             $aPageNumbers[] = 0; // Ellipsys;
265 262
         }
266
-        for($i = $nSlidingStart - $nSlidingStartOffset; $i <= $nSlidingEnd + $nSlidingEndOffset; $i++)
263
+        for ($i = $nSlidingStart - $nSlidingStartOffset; $i <= $nSlidingEnd + $nSlidingEndOffset; $i++)
267 264
         {
268 265
             $aPageNumbers[] = $i;
269 266
         }
270
-        if($nSlidingEnd < $this->nPagesCount)
267
+        if ($nSlidingEnd < $this->nPagesCount)
271 268
         {
272 269
             $aPageNumbers[] = 0; // Ellipsys;
273 270
             $aPageNumbers[] = $this->nPagesCount;
@@ -293,7 +290,7 @@  discard block
 block discarded – undo
293 290
      */
294 291
     public function pages(): array
295 292
     {
296
-        if($this->nPagesCount < 2)
293
+        if ($this->nPagesCount < 2)
297 294
         {
298 295
             return [];
299 296
         }
@@ -344,7 +341,7 @@  discard block
 block discarded – undo
344 341
     private function renderLinks(): string
345 342
     {
346 343
         $aPages = $this->pages();
347
-        if(count($aPages) === 0)
344
+        if (count($aPages) === 0)
348 345
         {
349 346
             return '';
350 347
         }
@@ -365,7 +362,7 @@  discard block
 block discarded – undo
365 362
     {
366 363
         $sHtml = $this->renderLinks();
367 364
         // The HTML code must always be displayed, even if it is empty.
368
-        if(is_a($this->xPlugin->response(), Response::class))
365
+        if (is_a($this->xPlugin->response(), Response::class))
369 366
         {
370 367
             /** @var Response */
371 368
             $xResponse = $this->xPlugin->response();
@@ -388,13 +385,13 @@  discard block
 block discarded – undo
388 385
      */
389 386
     public function render(JsExpr $xCall, string $sWrapperId = ''): void
390 387
     {
391
-        if(($xFunc = $xCall->func()) === null)
388
+        if (($xFunc = $xCall->func()) === null)
392 389
         {
393 390
             return;
394 391
         }
395 392
 
396 393
         $aParams = $this->showLinks(trim($sWrapperId));
397
-        if($aParams !== null)
394
+        if ($aParams !== null)
398 395
         {
399 396
             // Set click handlers on the pagination links
400 397
             $aParams['func'] = $xFunc->withPage()->jsonSerialize();
Please login to merge, or discard this patch.
jaxon-core/src/App/View/ViewTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
     {
54 54
         $this->sDirectory = '';
55 55
         $this->sExtension = '';
56
-        if(isset($this->aDirectories[$sNamespace]))
56
+        if (isset($this->aDirectories[$sNamespace]))
57 57
         {
58 58
             // Make sure there's only one '/' at the end of the string
59 59
             $this->sDirectory = rtrim($this->aDirectories[$sNamespace]['path'], '/') . '/';
Please login to merge, or discard this patch.
jaxon-core/src/App/View/TemplateView.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         $sViewName = $store->getViewName();
60 60
         $sNamespace = $store->getNamespace();
61 61
         // In this view renderer, the namespace must always be prepended to the view name.
62
-        if(substr($sViewName, 0, strlen($sNamespace) + 2) != $sNamespace . '::')
62
+        if (substr($sViewName, 0, strlen($sNamespace) + 2) != $sNamespace . '::')
63 63
         {
64 64
             $sViewName = $sNamespace . '::' . $sViewName;
65 65
         }
Please login to merge, or discard this patch.