Passed
Push — main ( 7f530d...7aae9b )
by Thierry
05:54
created
jaxon-dialogs/src/DialogManager.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
      */
106 106
     public function registerLibrary(string $sClassName, string $sLibraryName): void
107 107
     {
108
-        if(isset($this->aLibraries[$sLibraryName]))
108
+        if (isset($this->aLibraries[$sLibraryName]))
109 109
         {
110 110
             return;
111 111
         }
112
-        if(!($aInterfaces = class_implements($sClassName)))
112
+        if (!($aInterfaces = class_implements($sClassName)))
113 113
         {
114 114
             // The class is invalid.
115 115
             $sMessage = $this->xTranslator->trans('errors.register.invalid', ['name' => $sClassName]);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         $bIsConfirm = in_array(ConfirmInterface::class, $aInterfaces);
120 120
         $bIsAlert = in_array(AlertInterface::class, $aInterfaces);
121 121
         $bIsModal = in_array(ModalInterface::class, $aInterfaces);
122
-        if(!$bIsConfirm && !$bIsAlert && !$bIsModal)
122
+        if (!$bIsConfirm && !$bIsAlert && !$bIsModal)
123 123
         {
124 124
             // The class is invalid.
125 125
             $sMessage = $this->xTranslator->trans('errors.register.invalid', ['name' => $sClassName]);
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      */
160 160
     public function setConfirmLibrary(string $sLibraryName)
161 161
     {
162
-        if(!isset($this->aLibraries[$sLibraryName]) || !$this->aLibraries[$sLibraryName]['confirm'])
162
+        if (!isset($this->aLibraries[$sLibraryName]) || !$this->aLibraries[$sLibraryName]['confirm'])
163 163
         {
164 164
             $sMessage = $this->xTranslator->trans('errors.dialog.library',
165 165
                 ['type' => 'confirm', 'name' => $sLibraryName]);
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
      */
190 190
     public function setAlertLibrary(string $sLibraryName): void
191 191
     {
192
-        if(!isset($this->aLibraries[$sLibraryName]) || !$this->aLibraries[$sLibraryName]['alert'])
192
+        if (!isset($this->aLibraries[$sLibraryName]) || !$this->aLibraries[$sLibraryName]['alert'])
193 193
         {
194 194
             $sMessage = $this->xTranslator->trans('errors.dialog.library',
195 195
                 ['type' => 'alert', 'name' => $sLibraryName]);
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
      */
220 220
     public function setModalLibrary(string $sLibraryName): void
221 221
     {
222
-        if(!isset($this->aLibraries[$sLibraryName]) || !$this->aLibraries[$sLibraryName]['modal'])
222
+        if (!isset($this->aLibraries[$sLibraryName]) || !$this->aLibraries[$sLibraryName]['modal'])
223 223
         {
224 224
             $sMessage = $this->xTranslator->trans('errors.dialog.library',
225 225
                 ['type' => 'modal', 'name' => $sLibraryName]);
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     protected function registerLibraries(): void
249 249
     {
250 250
         $aLibraries = $this->xConfigManager->getAppOption('dialogs.lib.ext', []);
251
-        foreach($aLibraries as $sLibraryName => $sClassName)
251
+        foreach ($aLibraries as $sLibraryName => $sClassName)
252 252
         {
253 253
             $this->registerLibrary($sClassName, $sLibraryName);
254 254
         }
@@ -263,19 +263,19 @@  discard block
 block discarded – undo
263 263
     protected function setDefaultLibraries(): void
264 264
     {
265 265
         // Set the default modal library
266
-        if(($sLibraryName = $this->xConfigManager->getAppOption('dialogs.default.modal', '')))
266
+        if (($sLibraryName = $this->xConfigManager->getAppOption('dialogs.default.modal', '')))
267 267
         {
268 268
             $this->setModalLibrary($sLibraryName);
269 269
             $this->aLibraries[$sLibraryName]['used'] = true;
270 270
         }
271 271
         // Set the default alert library
272
-        if(($sLibraryName = $this->xConfigManager->getAppOption('dialogs.default.alert', '')))
272
+        if (($sLibraryName = $this->xConfigManager->getAppOption('dialogs.default.alert', '')))
273 273
         {
274 274
             $this->setAlertLibrary($sLibraryName);
275 275
             $this->aLibraries[$sLibraryName]['used'] = true;
276 276
         }
277 277
         // Set the default confirm library
278
-        if(($sLibraryName = $this->xConfigManager->getAppOption('dialogs.default.confirm', '')))
278
+        if (($sLibraryName = $this->xConfigManager->getAppOption('dialogs.default.confirm', '')))
279 279
         {
280 280
             $this->setConfirmLibrary($sLibraryName);
281 281
             $this->aLibraries[$sLibraryName]['used'] = true;
@@ -291,9 +291,9 @@  discard block
 block discarded – undo
291 291
     {
292 292
         // Set the other libraries in use
293 293
         $aLibraries = $this->xConfigManager->getAppOption('dialogs.lib.use', []);
294
-        foreach($aLibraries as $sLibraryName)
294
+        foreach ($aLibraries as $sLibraryName)
295 295
         {
296
-            if(isset($this->aLibraries[$sLibraryName])) // Make sure the library exists
296
+            if (isset($this->aLibraries[$sLibraryName])) // Make sure the library exists
297 297
             {
298 298
                 $this->aLibraries[$sLibraryName]['used'] = true;
299 299
             }
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
      */
328 328
     public function onChange(Config $xConfig, string $sName): void
329 329
     {
330
-        if($sName === '')
330
+        if ($sName === '')
331 331
         {
332 332
             // Reset the default libraries any time the config is changed.
333 333
             $this->registerLibraries();
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
             return;
337 337
         }
338 338
         $sPrefix = substr($sName, 0, 15);
339
-        switch($sPrefix)
339
+        switch ($sPrefix)
340 340
         {
341 341
         case 'dialogs.default':
342 342
             $this->setDefaultLibraries();
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -293,10 +293,12 @@
 block discarded – undo
293 293
         $aLibraries = $this->xConfigManager->getAppOption('dialogs.lib.use', []);
294 294
         foreach($aLibraries as $sLibraryName)
295 295
         {
296
-            if(isset($this->aLibraries[$sLibraryName])) // Make sure the library exists
296
+            if(isset($this->aLibraries[$sLibraryName])) {
297
+                // Make sure the library exists
297 298
             {
298 299
                 $this->aLibraries[$sLibraryName]['used'] = true;
299 300
             }
301
+            }
300 302
         }
301 303
     }
302 304
 
Please login to merge, or discard this patch.
jaxon-flot/src/Data/Ticks.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     public function point($iXaxis, $sLabel): static
55 55
     {
56 56
         $this->aPoints[] = $iXaxis;
57
-        if(!$this->aLabels['data'])
57
+        if (!$this->aLabels['data'])
58 58
         {
59 59
             $this->aLabels['data'] = [];
60 60
         }
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function points($aPoints): int
73 73
     {
74
-        foreach($aPoints as $aPoint)
74
+        foreach ($aPoints as $aPoint)
75 75
         {
76
-            if(count($aPoint) == 2)
76
+            if (count($aPoint) == 2)
77 77
             {
78 78
                 $this->point($aPoint[0], $aPoint[1]);
79 79
             }
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
      */
97 97
     public function expr($iStart, $iEnd, $iStep, $sJsLabel): int
98 98
     {
99
-        for($x = $iStart; $x < $iEnd; $x += $iStep)
99
+        for ($x = $iStart; $x < $iEnd; $x += $iStep)
100 100
         {
101 101
             $this->aPoints[] = $x;
102 102
         }
103
-        if(($sJsLabel))
103
+        if (($sJsLabel))
104 104
         {
105 105
             $this->aLabels['func'] = $sJsLabel;
106 106
         }
Please login to merge, or discard this patch.
jaxon-flot/src/Data/Series.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
     public function point($iXaxis, $xValue, $sLabel = ''): static
62 62
     {
63 63
         $this->aPoints[] = $iXaxis;
64
-        if(!$this->aValues['data'])
64
+        if (!$this->aValues['data'])
65 65
         {
66 66
             $this->aValues['data'] = [];
67 67
         }
68 68
         $this->aValues['data'][$iXaxis] = $xValue;
69
-        if(($sLabel))
69
+        if (($sLabel))
70 70
         {
71
-            if(!$this->aLabels['data'])
71
+            if (!$this->aLabels['data'])
72 72
             {
73 73
                 $this->aLabels['data'] = [];
74 74
             }
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function points($aPoints): int
88 88
     {
89
-        foreach($aPoints as $aPoint)
89
+        foreach ($aPoints as $aPoint)
90 90
         {
91
-            if(count($aPoint) === 2)
91
+            if (count($aPoint) === 2)
92 92
             {
93 93
                 $this->point($aPoint[0], $aPoint[1]);
94 94
             }
95
-            else if(count($aPoint) === 3)
95
+            else if (count($aPoint) === 3)
96 96
             {
97 97
                 $this->point($aPoint[0], $aPoint[1], $aPoint[2]);
98 98
             }
@@ -118,12 +118,12 @@  discard block
 block discarded – undo
118 118
      */
119 119
     public function expr($iStart, $iEnd, $iStep, $sJsValue, $sJsLabel = ''): int
120 120
     {
121
-        for($x = $iStart; $x < $iEnd; $x += $iStep)
121
+        for ($x = $iStart; $x < $iEnd; $x += $iStep)
122 122
         {
123 123
             $this->aPoints[] = $x;
124 124
         }
125 125
         $this->aValues['func'] = $sJsValue;
126
-        if(($sJsLabel))
126
+        if (($sJsLabel))
127 127
         {
128 128
             $this->aLabels['func'] = $sJsLabel;
129 129
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,7 @@
 block discarded – undo
91 91
             if(count($aPoint) === 2)
92 92
             {
93 93
                 $this->point($aPoint[0], $aPoint[1]);
94
-            }
95
-            else if(count($aPoint) === 3)
94
+            } else if(count($aPoint) === 3)
96 95
             {
97 96
                 $this->point($aPoint[0], $aPoint[1], $aPoint[2]);
98 97
             }
Please login to merge, or discard this patch.
jaxon-flot/src/FlotPlugin.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,8 +75,7 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function getScript(): string
77 77
     {
78
-        return $this->xConfigManager->getOption('js.app.export', false) ? '' :
79
-            $this->xTemplateEngine->render('jaxon::flot::flot.js');
78
+        return $this->xConfigManager->getOption('js.app.export', false) ? '' : $this->xTemplateEngine->render('jaxon::flot::flot.js');
80 79
     }
81 80
 
82 81
     /**
@@ -84,7 +83,7 @@  discard block
 block discarded – undo
84 83
      */
85 84
     public function getJsCode(): ?JsCode
86 85
     {
87
-        if(!$this->xConfigManager->getOption('js.app.export', false))
86
+        if (!$this->xConfigManager->getOption('js.app.export', false))
88 87
         {
89 88
             return null;
90 89
         }
Please login to merge, or discard this patch.
jaxon-examples/templates/component/pagination/wrapper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <nav><ul class="pagination"><?php
2
-    if(($this->prev))
2
+    if (($this->prev))
3 3
     {
4 4
         echo $this->prev;
5 5
     }
6
-    foreach($this->links as $link)
6
+    foreach ($this->links as $link)
7 7
     {
8 8
         echo $link;
9 9
     }
10
-    if(($this->next))
10
+    if (($this->next))
11 11
     {
12 12
         echo $this->next;
13 13
     }
Please login to merge, or discard this patch.
jaxon-examples/templates/examples/nav.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
             <div class="col-12">
6 6
                 <a href="/"><span class="badge bg-<?= $current === '' ?
7 7
                     'primary' : 'secondary'; ?>">Home</span></a>
8
-<?php foreach(menu_entries() as $example => $page): ?>
8
+<?php foreach (menu_entries() as $example => $page): ?>
9 9
                 <a href="<?= menu_url($example) ?>"><span class="badge bg-<?php 
10 10
                     echo $current === $example ? 'primary' : 'secondary'; ?>"><?php
11 11
                     echo $page['title'] ?></span></a>
Please login to merge, or discard this patch.
jaxon-examples/templates/examples/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 </p>
17 17
                     </div>
18 18
                 </div>
19
-<?php foreach(menu_entries() as $example => $page): ?>
19
+<?php foreach (menu_entries() as $example => $page): ?>
20 20
                 <div class="row col-md-12">
21 21
                     <div class="col-md-12">
22 22
 <h5 style="margin-top:15px;"><a href="<?= menu_url($example) ?>"><?= $page['title'] ?></a></h5>
Please login to merge, or discard this patch.
jaxon-examples/classes/namespace/app/Test/Test.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@
 block discarded – undo
8 8
     {
9 9
         $text = $isCaps ? 'HELLO WORLD!' : 'Hello World!';
10 10
         $this->response->assign('div1', 'innerHTML', $text);
11
-        if(($bNotify))
11
+        if (($bNotify))
12 12
             $this->response->dialog->success("div1 text is now $text");
13 13
     }
14 14
 
15 15
     public function setColor(string $sColor, bool $bNotify = true)
16 16
     {
17 17
         $this->response->assign('div1', 'style.color', $sColor);
18
-        if(($bNotify))
18
+        if (($bNotify))
19 19
             $this->response->dialog->success("div1 color is now $sColor");
20 20
     }
21 21
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,15 +8,17 @@
 block discarded – undo
8 8
     {
9 9
         $text = $isCaps ? 'HELLO WORLD!' : 'Hello World!';
10 10
         $this->response->assign('div1', 'innerHTML', $text);
11
-        if(($bNotify))
12
-            $this->response->dialog->success("div1 text is now $text");
11
+        if(($bNotify)) {
12
+                    $this->response->dialog->success("div1 text is now $text");
13
+        }
13 14
     }
14 15
 
15 16
     public function setColor(string $sColor, bool $bNotify = true)
16 17
     {
17 18
         $this->response->assign('div1', 'style.color', $sColor);
18
-        if(($bNotify))
19
-            $this->response->dialog->success("div1 color is now $sColor");
19
+        if(($bNotify)) {
20
+                    $this->response->dialog->success("div1 color is now $sColor");
21
+        }
20 22
     }
21 23
 
22 24
     public function showDialog()
Please login to merge, or discard this patch.
jaxon-examples/classes/namespace/ext/Test/Test.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,14 +8,14 @@
 block discarded – undo
8 8
     {
9 9
         $text = $isCaps ? 'HELLO WORLD!' : 'Hello World!';
10 10
         $this->response->assign('div2', 'innerHTML', $text);
11
-        if(($bNotify))
11
+        if (($bNotify))
12 12
             $this->response->dialog->success("div2 text is now $text");
13 13
     }
14 14
 
15 15
     public function setColor(string $sColor, bool $bNotify = true)
16 16
     {
17 17
         $this->response->assign('div2', 'style.color', $sColor);
18
-        if(($bNotify))
18
+        if (($bNotify))
19 19
             $this->response->dialog->success("div2 color is now $sColor");
20 20
     }
21 21
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,15 +8,17 @@
 block discarded – undo
8 8
     {
9 9
         $text = $isCaps ? 'HELLO WORLD!' : 'Hello World!';
10 10
         $this->response->assign('div2', 'innerHTML', $text);
11
-        if(($bNotify))
12
-            $this->response->dialog->success("div2 text is now $text");
11
+        if(($bNotify)) {
12
+                    $this->response->dialog->success("div2 text is now $text");
13
+        }
13 14
     }
14 15
 
15 16
     public function setColor(string $sColor, bool $bNotify = true)
16 17
     {
17 18
         $this->response->assign('div2', 'style.color', $sColor);
18
-        if(($bNotify))
19
-            $this->response->dialog->success("div2 color is now $sColor");
19
+        if(($bNotify)) {
20
+                    $this->response->dialog->success("div2 color is now $sColor");
21
+        }
20 22
     }
21 23
 
22 24
     public function showDialog()
Please login to merge, or discard this patch.