Passed
Push — master ( c910d7...729ca2 )
by Thierry
02:16
created
src/App/Dialog/Library/DialogLibraryManager.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -123,19 +123,19 @@  discard block
 block discarded – undo
123 123
     {
124 124
         $bIsUsed = false;
125 125
         $aInterfaces = class_implements($sClassName);
126
-        if(in_array(QuestionInterface::class, $aInterfaces))
126
+        if (in_array(QuestionInterface::class, $aInterfaces))
127 127
         {
128 128
             $this->aQuestionLibraries[$sLibraryName] = $bIsUsed = true;
129 129
         }
130
-        if(in_array(MessageInterface::class, $aInterfaces))
130
+        if (in_array(MessageInterface::class, $aInterfaces))
131 131
         {
132 132
             $this->aMessageLibraries[$sLibraryName] = $bIsUsed = true;
133 133
         }
134
-        if(in_array(ModalInterface::class, $aInterfaces))
134
+        if (in_array(ModalInterface::class, $aInterfaces))
135 135
         {
136 136
             $this->aModalLibraries[$sLibraryName] = $bIsUsed = true;
137 137
         }
138
-        if(!$bIsUsed)
138
+        if (!$bIsUsed)
139 139
         {
140 140
             // The class is invalid.
141 141
             $sMessage = $this->xTranslator->trans('errors.register.invalid', ['name' => $sClassName]);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
      */
168 168
     public function setQuestionLibrary(string $sLibraryName)
169 169
     {
170
-        if(!isset($this->aQuestionLibraries[$sLibraryName]))
170
+        if (!isset($this->aQuestionLibraries[$sLibraryName]))
171 171
         {
172 172
             $sMessage = $this->xTranslator->trans('errors.dialog.library',
173 173
                 ['type' => 'question', 'name' => $sLibraryName]);
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
      */
198 198
     public function setMessageLibrary(string $sLibraryName)
199 199
     {
200
-        if(!isset($this->aMessageLibraries[$sLibraryName]))
200
+        if (!isset($this->aMessageLibraries[$sLibraryName]))
201 201
         {
202 202
             $sMessage = $this->xTranslator->trans('errors.dialog.library',
203 203
                 ['type' => 'message', 'name' => $sLibraryName]);
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
      */
228 228
     public function setModalLibrary(string $sLibraryName)
229 229
     {
230
-        if(!isset($this->aModalLibraries[$sLibraryName]))
230
+        if (!isset($this->aModalLibraries[$sLibraryName]))
231 231
         {
232 232
             $sMessage = $this->xTranslator->trans('errors.dialog.library',
233 233
                 ['type' => 'modal', 'name' => $sLibraryName]);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     protected function registerLibraries()
269 269
     {
270 270
         $aLibraries = $this->xConfigManager->getOption('dialogs.classes', []);
271
-        foreach($aLibraries as $sLibraryName => $sClassName)
271
+        foreach ($aLibraries as $sLibraryName => $sClassName)
272 272
         {
273 273
             $this->registerLibrary($sClassName, $sLibraryName);
274 274
         }
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     protected function updateLibraries()
283 283
     {
284 284
         $aLibraries = $this->xConfigManager->getOption('dialogs.libraries', []);
285
-        foreach($aLibraries as $sLibraryName)
285
+        foreach ($aLibraries as $sLibraryName)
286 286
         {
287 287
             $this->aLibraries[$sLibraryName] = true;
288 288
         }
@@ -297,17 +297,17 @@  discard block
 block discarded – undo
297 297
     protected function setDefaultLibraries()
298 298
     {
299 299
         // Set the default modal library
300
-        if(($sLibraryName = $this->xConfigManager->getOption('dialogs.default.modal', '')))
300
+        if (($sLibraryName = $this->xConfigManager->getOption('dialogs.default.modal', '')))
301 301
         {
302 302
             $this->setModalLibrary($sLibraryName);
303 303
         }
304 304
         // Set the default message library
305
-        if(($sLibraryName = $this->xConfigManager->getOption('dialogs.default.message', '')))
305
+        if (($sLibraryName = $this->xConfigManager->getOption('dialogs.default.message', '')))
306 306
         {
307 307
             $this->setMessageLibrary($sLibraryName);
308 308
         }
309 309
         // Set the default question library
310
-        if(($sLibraryName = $this->xConfigManager->getOption('dialogs.default.question', '')))
310
+        if (($sLibraryName = $this->xConfigManager->getOption('dialogs.default.question', '')))
311 311
         {
312 312
             $this->setQuestionLibrary($sLibraryName);
313 313
         }
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
      */
320 320
     public function onChange(Config $xConfig, string $sName)
321 321
     {
322
-        if($sName === '')
322
+        if ($sName === '')
323 323
         {
324 324
             // Reset the default libraries any time the config is changed.
325 325
             $this->registerLibraries();
@@ -327,17 +327,17 @@  discard block
 block discarded – undo
327 327
             $this->setDefaultLibraries();
328 328
             return;
329 329
         }
330
-        if(substr($sName, 0, 15) === 'dialogs.classes')
330
+        if (substr($sName, 0, 15) === 'dialogs.classes')
331 331
         {
332 332
             $this->registerLibraries();
333 333
             return;
334 334
         }
335
-        if($sName === 'dialogs.libraries')
335
+        if ($sName === 'dialogs.libraries')
336 336
         {
337 337
             $this->updateLibraries();
338 338
             return;
339 339
         }
340
-        if(substr($sName, 0, 15) === 'dialogs.default')
340
+        if (substr($sName, 0, 15) === 'dialogs.default')
341 341
         {
342 342
             $this->setDefaultLibraries();
343 343
         }
Please login to merge, or discard this patch.
src/App/I18n/Translator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     public function onChange(Config $xConfig, string $sName)
27 27
     {
28 28
         // Set the library language any time the config is changed.
29
-        if($sName === '' || $sName === 'core.language')
29
+        if ($sName === '' || $sName === 'core.language')
30 30
         {
31 31
             $this->setLocale($xConfig->getOption('core.language'));
32 32
         }
Please login to merge, or discard this patch.