Passed
Push — master ( 8b4203...c04040 )
by Nashwan
02:43 queued 10s
created
src/EBloodBank/Main.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -223,18 +223,18 @@  discard block
 block discarded – undo
223 223
     private function setupCurrentLocale()
224 224
     {
225 225
         $defaultLocale = Locales::findLocale(EBB_DEFAULT_LOCALE);
226
-        if (! empty($defaultLocale)) {
226
+        if (!empty($defaultLocale)) {
227 227
             Locales::setDefaultLocale($defaultLocale);
228 228
         }
229 229
 
230 230
         $siteLocale = Locales::findLocale(Options::getOption('site_locale'));
231
-        if (! empty($siteLocale)) {
231
+        if (!empty($siteLocale)) {
232 232
             Locales::setCurrentLocale($siteLocale);
233 233
         }
234 234
 
235 235
         $currentLocale = Locales::getCurrentLocale();
236 236
 
237
-        if (! empty($currentLocale)) {
237
+        if (!empty($currentLocale)) {
238 238
             $this->getTranslator()->loadTranslations($currentLocale->getTranslations());
239 239
         }
240 240
     }
@@ -247,21 +247,21 @@  discard block
 block discarded – undo
247 247
     private function setupCurrentTheme()
248 248
     {
249 249
         $defaultTheme = Themes::findTheme(EBB_DEFAULT_THEME);
250
-        if (! empty($defaultTheme)) {
250
+        if (!empty($defaultTheme)) {
251 251
             Themes::setDefaultTheme($defaultTheme);
252 252
         }
253 253
 
254 254
         $siteTheme = Themes::findTheme(Options::getOption('site_theme'));
255
-        if (! empty($siteTheme)) {
255
+        if (!empty($siteTheme)) {
256 256
             Themes::setCurrentTheme($siteTheme);
257 257
         }
258 258
 
259 259
         $currentLocale = Locales::getCurrentLocale();
260 260
 
261
-        if (! empty($currentLocale)) {
261
+        if (!empty($currentLocale)) {
262 262
             $currentTheme = Themes::getCurrentTheme();
263 263
             $themeLocale = $currentTheme->findLocale($currentLocale->getCode());
264
-            if (! empty($themeLocale)) {
264
+            if (!empty($themeLocale)) {
265 265
                 $themeTranslations = $themeLocale->getTranslations();
266 266
                 $themeDomain = $currentTheme->getData('Textdomain', $currentTheme->getName());
267 267
                 $themeTranslations->setDomain($themeDomain);
@@ -288,106 +288,106 @@  discard block
 block discarded – undo
288 288
     {
289 289
         $container = $this->getContainer();
290 290
         $controllers = [
291
-            'home' => function () use ($container) {
291
+            'home' => function() use ($container) {
292 292
                 return new Controllers\Home($container);
293 293
             },
294
-            'login' => function () use ($container) {
294
+            'login' => function() use ($container) {
295 295
                 return new Controllers\Login($container);
296 296
             },
297
-            'signup' => function () use ($container) {
297
+            'signup' => function() use ($container) {
298 298
                 return new Controllers\Signup($container);
299 299
             },
300
-            'install' => function () use ($container) {
300
+            'install' => function() use ($container) {
301 301
                 return new Controllers\Install($container);
302 302
             },
303
-            'settings' => function () use ($container) {
303
+            'settings' => function() use ($container) {
304 304
                 return new Controllers\Settings($container);
305 305
             },
306
-            'view-users' => function () use ($container) {
306
+            'view-users' => function() use ($container) {
307 307
                 return new Controllers\ViewUsers($container);
308 308
             },
309
-            'view-donors' => function () use ($container) {
309
+            'view-donors' => function() use ($container) {
310 310
                 return new Controllers\ViewDonors($container);
311 311
             },
312
-            'view-cities' => function () use ($container) {
312
+            'view-cities' => function() use ($container) {
313 313
                 return new Controllers\ViewCities($container);
314 314
             },
315
-            'view-districts' => function () use ($container) {
315
+            'view-districts' => function() use ($container) {
316 316
                 return new Controllers\ViewDistricts($container);
317 317
             },
318
-            'view-donor' => function ($id) use ($container) {
318
+            'view-donor' => function($id) use ($container) {
319 319
                 return new Controllers\ViewDonor($container, $id);
320 320
             },
321
-            'add-user' => function () use ($container) {
321
+            'add-user' => function() use ($container) {
322 322
                 return new Controllers\AddUser($container);
323 323
             },
324
-            'add-donor' => function () use ($container) {
324
+            'add-donor' => function() use ($container) {
325 325
                 return new Controllers\AddDonor($container);
326 326
             },
327
-            'add-city' => function () use ($container) {
327
+            'add-city' => function() use ($container) {
328 328
                 return new Controllers\AddCity($container);
329 329
             },
330
-            'add-district' => function () use ($container) {
330
+            'add-district' => function() use ($container) {
331 331
                 return new Controllers\AddDistrict($container);
332 332
             },
333
-            'edit-user' => function ($id) use ($container) {
333
+            'edit-user' => function($id) use ($container) {
334 334
                 return new Controllers\EditUser($container, $id);
335 335
             },
336
-            'edit-donor' => function ($id) use ($container) {
336
+            'edit-donor' => function($id) use ($container) {
337 337
                 return new Controllers\EditDonor($container, $id);
338 338
             },
339
-            'edit-city' => function ($id) use ($container) {
339
+            'edit-city' => function($id) use ($container) {
340 340
                 return new Controllers\EditCity($container, $id);
341 341
             },
342
-            'edit-district' => function ($id) use ($container) {
342
+            'edit-district' => function($id) use ($container) {
343 343
                 return new Controllers\EditDistrict($container, $id);
344 344
             },
345
-            'delete-user' => function ($id) use ($container) {
345
+            'delete-user' => function($id) use ($container) {
346 346
                 return new Controllers\DeleteUser($container, $id);
347 347
             },
348
-            'delete-donor' => function ($id) use ($container) {
348
+            'delete-donor' => function($id) use ($container) {
349 349
                 return new Controllers\DeleteDonor($container, $id);
350 350
             },
351
-            'delete-city' => function ($id) use ($container) {
351
+            'delete-city' => function($id) use ($container) {
352 352
                 return new Controllers\DeleteCity($container, $id);
353 353
             },
354
-            'delete-district' => function ($id) use ($container) {
354
+            'delete-district' => function($id) use ($container) {
355 355
                 return new Controllers\DeleteDistrict($container, $id);
356 356
             },
357
-            'activate-user' => function ($id) use ($container) {
357
+            'activate-user' => function($id) use ($container) {
358 358
                 return new Controllers\ActivateUser($container, $id);
359 359
             },
360
-            'approve-donor' => function ($id) use ($container) {
360
+            'approve-donor' => function($id) use ($container) {
361 361
                 return new Controllers\ApproveDonor($container, $id);
362 362
             },
363
-            'edit-users' => function () use ($container) {
363
+            'edit-users' => function() use ($container) {
364 364
                 return new Controllers\EditUsers($container);
365 365
             },
366
-            'edit-donors' => function () use ($container) {
366
+            'edit-donors' => function() use ($container) {
367 367
                 return new Controllers\EditDonors($container);
368 368
             },
369
-            'edit-cities' => function () use ($container) {
369
+            'edit-cities' => function() use ($container) {
370 370
                 return new Controllers\EditCities($container);
371 371
             },
372
-            'edit-districts' => function () use ($container) {
372
+            'edit-districts' => function() use ($container) {
373 373
                 return new Controllers\EditDistricts($container);
374 374
             },
375
-            'delete-users' => function () use ($container) {
375
+            'delete-users' => function() use ($container) {
376 376
                 return new Controllers\DeleteUsers($container);
377 377
             },
378
-            'delete-donors' => function () use ($container) {
378
+            'delete-donors' => function() use ($container) {
379 379
                 return new Controllers\DeleteDonors($container);
380 380
             },
381
-            'delete-cities' => function () use ($container) {
381
+            'delete-cities' => function() use ($container) {
382 382
                 return new Controllers\DeleteCities($container);
383 383
             },
384
-            'delete-districts' => function () use ($container) {
384
+            'delete-districts' => function() use ($container) {
385 385
                 return new Controllers\DeleteDistricts($container);
386 386
             },
387
-            'activate-users' => function () use ($container) {
387
+            'activate-users' => function() use ($container) {
388 388
                 return new Controllers\ActivateUsers($container);
389 389
             },
390
-            'approve-donors' => function () use ($container) {
390
+            'approve-donors' => function() use ($container) {
391 391
                 return new Controllers\ApproveDonors($container);
392 392
             },
393 393
         ];
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
             $instance->setupDispatcher();
481 481
 
482 482
             // Dispatch!
483
-            if (! isCLI()) {
483
+            if (!isCLI()) {
484 484
                 $instance->dispatch();
485 485
             }
486 486
         }
Please login to merge, or discard this patch.
src/EBloodBank/Locales.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
142 142
         $dirPath = trimTrailingSlash($dirPath);
143 143
         $localePath = realpath("{$dirPath}/{$code}.mo");
144 144
 
145
-        if (! $localePath || ! is_readable($localePath)) {
145
+        if (!$localePath || !is_readable($localePath)) {
146 146
             return;
147 147
         }
148 148
 
Please login to merge, or discard this patch.
src/EBloodBank/Controllers/DeleteDonor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function __invoke()
49 49
     {
50
-        if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'delete')) {
50
+        if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'delete')) {
51 51
             $this->viewFactory->displayView('error-403');
52 52
             return;
53 53
         }
@@ -56,14 +56,14 @@  discard block
 block discarded – undo
56 56
             $this->donor = $this->getDonorRepository()->find($this->donorId);
57 57
         }
58 58
 
59
-        if (! $this->donor) {
59
+        if (!$this->donor) {
60 60
             $this->viewFactory->displayView('error-404');
61 61
             return;
62 62
         }
63 63
 
64 64
         $donor = $this->donor;
65 65
 
66
-        if (! $this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $donor)) {
66
+        if (!$this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $donor)) {
67 67
             $this->viewFactory->displayView('error-403');
68 68
             return;
69 69
         }
@@ -99,13 +99,13 @@  discard block
 block discarded – undo
99 99
         $sessionToken = $this->getSession()->getCsrfToken();
100 100
         $actionToken = filter_input(INPUT_POST, 'token');
101 101
 
102
-        if (! $actionToken || ! $sessionToken->isValid($actionToken)) {
102
+        if (!$actionToken || !$sessionToken->isValid($actionToken)) {
103 103
             return;
104 104
         }
105 105
 
106 106
         $donor = $this->donor;
107 107
 
108
-        if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $donor)) {
108
+        if (!$this->hasAuthenticatedUser() || !$this->getAcl()->canDeleteEntity($this->getAuthenticatedUser(), $donor)) {
109 109
             return;
110 110
         }
111 111
 
Please login to merge, or discard this patch.
src/EBloodBank/Controllers/EditDonor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function __invoke()
51 51
     {
52
-        if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'edit')) {
52
+        if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'edit')) {
53 53
             $this->viewFactory->displayView('error-403');
54 54
             return;
55 55
         }
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
             $this->donor = $this->getDonorRepository()->find($this->donorId);
59 59
         }
60 60
 
61
-        if (! $this->donor) {
61
+        if (!$this->donor) {
62 62
             $this->viewFactory->displayView('error-404');
63 63
             return;
64 64
         }
65 65
 
66 66
         $donor = $this->donor;
67 67
 
68
-        if (! $this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $donor)) {
68
+        if (!$this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $donor)) {
69 69
             $this->viewFactory->displayView('error-403');
70 70
             return;
71 71
         }
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
             $sessionToken = $this->getSession()->getCsrfToken();
115 115
             $actionToken = filter_input(INPUT_POST, 'token');
116 116
 
117
-            if (! $actionToken || ! $sessionToken->isValid($actionToken)) {
117
+            if (!$actionToken || !$sessionToken->isValid($actionToken)) {
118 118
                 return;
119 119
             }
120 120
 
121 121
             $donor = $this->donor;
122 122
 
123
-            if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $donor)) {
123
+            if (!$this->hasAuthenticatedUser() || !$this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $donor)) {
124 124
                 return;
125 125
             }
126 126
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             $donor->setMeta('address', filter_input(INPUT_POST, 'donor_address'), true);
159 159
 
160 160
             // Set the donor status.
161
-            if ($donor->isApproved() && ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'approve')) {
161
+            if ($donor->isApproved() && !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'approve')) {
162 162
                 $donor->set('status', 'pending');
163 163
             }
164 164
 
Please login to merge, or discard this patch.
src/EBloodBank/Controllers/Signup.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 
70 70
             $duplicateUser = $this->getUserRepository()->findOneBy(['email' => $user->get('email'), 'status' => 'any']);
71 71
 
72
-            if (! empty($duplicateUser)) {
72
+            if (!empty($duplicateUser)) {
73 73
                 throw new InvalidArgumentException(__('Please enter another e-mail address.'));
74 74
             }
75 75
 
Please login to merge, or discard this patch.
src/EBloodBank/Controllers/EditDistrict.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function __invoke()
51 51
     {
52
-        if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'edit')) {
52
+        if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'District', 'edit')) {
53 53
             $this->viewFactory->displayView('error-403');
54 54
             return;
55 55
         }
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
             $this->district = $this->getDistrictRepository()->find($this->districtId);
59 59
         }
60 60
 
61
-        if (! $this->district) {
61
+        if (!$this->district) {
62 62
             $this->viewFactory->displayView('error-404');
63 63
             return;
64 64
         }
65 65
 
66 66
         $district = $this->district;
67 67
 
68
-        if (! $this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $district)) {
68
+        if (!$this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $district)) {
69 69
             $this->viewFactory->displayView('error-403');
70 70
             return;
71 71
         }
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
             $sessionToken = $this->getSession()->getCsrfToken();
115 115
             $actionToken = filter_input(INPUT_POST, 'token');
116 116
 
117
-            if (! $actionToken || ! $sessionToken->isValid($actionToken)) {
117
+            if (!$actionToken || !$sessionToken->isValid($actionToken)) {
118 118
                 return;
119 119
             }
120 120
 
121 121
             $district = $this->district;
122 122
 
123
-            if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $district)) {
123
+            if (!$this->hasAuthenticatedUser() || !$this->getAcl()->canEditEntity($this->getAuthenticatedUser(), $district)) {
124 124
                 return;
125 125
             }
126 126
 
Please login to merge, or discard this patch.
src/EBloodBank/Controllers/ApproveDonors.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function __invoke()
31 31
     {
32
-        if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'approve')) {
32
+        if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'approve')) {
33 33
             $this->viewFactory->displayView('error-403');
34 34
             return;
35 35
         }
36 36
 
37 37
         if (filter_has_var(INPUT_POST, 'donors')) {
38 38
             $donorsIDs = filter_input(INPUT_POST, 'donors', FILTER_SANITIZE_NUMBER_INT, FILTER_REQUIRE_ARRAY);
39
-            if (! empty($donorsIDs) && is_array($donorsIDs)) {
39
+            if (!empty($donorsIDs) && is_array($donorsIDs)) {
40 40
                 $this->donors = $this->getDonorRepository()->findBy(['id' => $donorsIDs]);
41 41
             }
42 42
         }
@@ -69,27 +69,27 @@  discard block
 block discarded – undo
69 69
      */
70 70
     protected function doApproveAction()
71 71
     {
72
-        if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'approve')) {
72
+        if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'Donor', 'approve')) {
73 73
             return;
74 74
         }
75 75
 
76 76
         $actionToken = filter_input(INPUT_POST, 'token');
77 77
         $sessionToken = $this->getSession()->getCsrfToken();
78 78
 
79
-        if (! $actionToken || ! $sessionToken->isValid($actionToken)) {
79
+        if (!$actionToken || !$sessionToken->isValid($actionToken)) {
80 80
             return;
81 81
         }
82 82
 
83 83
         $donors = $this->donors;
84 84
 
85
-        if (! $donors || ! is_array($donors)) {
85
+        if (!$donors || !is_array($donors)) {
86 86
             return;
87 87
         }
88 88
 
89 89
         $approvedDonorsCount = 0;
90 90
 
91 91
         foreach ($donors as $donor) {
92
-            if (! $donor->isPending()) {
92
+            if (!$donor->isPending()) {
93 93
                 continue;
94 94
             }
95 95
             if ($this->getAcl()->canApproveDonor($this->getAuthenticatedUser(), $donor)) {
Please login to merge, or discard this patch.
src/EBloodBank/Controllers/AddUser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function __invoke()
36 36
     {
37
-        if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'add')) {
37
+        if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'add')) {
38 38
             $this->viewFactory->displayView('error-403');
39 39
             return; 
40 40
         }
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
     protected function doSubmitAction()
83 83
     {
84 84
         try {
85
-            if (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'add')) {
85
+            if (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'User', 'add')) {
86 86
                 return;
87 87
             }
88 88
 
89 89
             $sessionToken = $this->getSession()->getCsrfToken();
90 90
             $actionToken = filter_input(INPUT_POST, 'token');
91 91
 
92
-            if (! $actionToken || ! $sessionToken->isValid($actionToken)) {
92
+            if (!$actionToken || !$sessionToken->isValid($actionToken)) {
93 93
                 return;
94 94
             }
95 95
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
             $duplicateUser = $this->getUserRepository()->findOneBy(['email' => $user->get('email'), 'status' => 'any']);
105 105
 
106
-            if (! empty($duplicateUser)) {
106
+            if (!empty($duplicateUser)) {
107 107
                 throw new InvalidArgumentException(__('Please enter a unique user e-mail.'));
108 108
             }
109 109
 
Please login to merge, or discard this patch.
src/EBloodBank/Controllers/ViewCities.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     public function __invoke()
26 26
     {
27 27
         $isSitePublic = ('on' === EBB\Options::getOption('site_publication'));
28
-        if (! $isSitePublic && (! $this->hasAuthenticatedUser() || ! $this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'City', 'read'))) {
28
+        if (!$isSitePublic && (!$this->hasAuthenticatedUser() || !$this->getAcl()->isUserAllowed($this->getAuthenticatedUser(), 'City', 'read'))) {
29 29
             $this->viewFactory->displayView('error-403');
30 30
         } else {
31 31
             $this->viewFactory->displayView('view-cities', [
Please login to merge, or discard this patch.