Passed
Push — master ( a3cc07...eb52df )
by Nashwan
03:50
created
bootstrap.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 }
28 28
 
29 29
 foreach (['spl', 'date', 'filter', 'session'] as $ext) {
30
-    if (! extension_loaded($ext)) {
30
+    if (!extension_loaded($ext)) {
31 31
         die(
32 32
             sprintf(
33 33
                 'eBloodBank requires the PHP extension %s.',
@@ -38,14 +38,14 @@  discard block
 block discarded – undo
38 38
 }
39 39
 
40 40
 if (function_exists('apache_get_modules')) {
41
-    if (! in_array('mod_rewrite', apache_get_modules())) {
41
+    if (!in_array('mod_rewrite', apache_get_modules())) {
42 42
         die('eBloodBank requires Apache mod_rewrite module.');
43 43
     }
44 44
 }
45 45
 
46 46
 /*** Paths Constants **********************************************************/
47 47
 
48
-if (! defined('EBB_DIR')) {
48
+if (!defined('EBB_DIR')) {
49 49
     define('EBB_DIR', dirname(__FILE__));
50 50
 }
51 51
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 /*** PHP Configurations *******************************************************/
58 58
 
59
-if (! ini_get('date.timezone')) {
59
+if (!ini_get('date.timezone')) {
60 60
     date_default_timezone_set('UTC');
61 61
 }
62 62
 
@@ -69,63 +69,63 @@  discard block
 block discarded – undo
69 69
     require_once EBB_DIR . '/config/config.php';
70 70
 }
71 71
 
72
-if (! defined('EBB_DB_NAME')) {
72
+if (!defined('EBB_DB_NAME')) {
73 73
     define('EBB_DB_NAME', '');
74 74
 }
75 75
 
76
-if (! defined('EBB_DB_USER')) {
76
+if (!defined('EBB_DB_USER')) {
77 77
     define('EBB_DB_USER', '');
78 78
 }
79 79
 
80
-if (! defined('EBB_DB_PASS')) {
80
+if (!defined('EBB_DB_PASS')) {
81 81
     define('EBB_DB_PASS', '');
82 82
 }
83 83
 
84
-if (! defined('EBB_DB_HOST')) {
84
+if (!defined('EBB_DB_HOST')) {
85 85
     define('EBB_DB_HOST', 'localhost');
86 86
 }
87 87
 
88
-if (! defined('EBB_DB_DRIVER')) {
88
+if (!defined('EBB_DB_DRIVER')) {
89 89
     define('EBB_DB_DRIVER', 'mysqli');
90 90
 }
91 91
 
92
-if (! defined('EBB_DEFAULT_THEME')) {
92
+if (!defined('EBB_DEFAULT_THEME')) {
93 93
     define('EBB_DEFAULT_THEME', 'winry');
94 94
 }
95 95
 
96
-if (! defined('EBB_DEFAULT_LOCALE')) {
96
+if (!defined('EBB_DEFAULT_LOCALE')) {
97 97
     define('EBB_DEFAULT_LOCALE', '');
98 98
 }
99 99
 
100
-if (! defined('EBB_REDIS_CACHE')) {
100
+if (!defined('EBB_REDIS_CACHE')) {
101 101
     define('EBB_REDIS_CACHE', false);
102 102
 }
103 103
 
104
-if (! defined('EBB_REDIS_HOST')) {
104
+if (!defined('EBB_REDIS_HOST')) {
105 105
     define('EBB_REDIS_HOST', 'localhost');
106 106
 }
107 107
 
108
-if (! defined('EBB_REDIS_PORT')) {
108
+if (!defined('EBB_REDIS_PORT')) {
109 109
     define('EBB_REDIS_PORT', 6379);
110 110
 }
111 111
 
112
-if (! defined('EBB_REDIS_DB')) {
112
+if (!defined('EBB_REDIS_DB')) {
113 113
     define('EBB_REDIS_DB', '');
114 114
 }
115 115
 
116
-if (! defined('EBB_REDIS_PASS')) {
116
+if (!defined('EBB_REDIS_PASS')) {
117 117
     define('EBB_REDIS_PASS', '');
118 118
 }
119 119
 
120
-if (! defined('EBB_APCU_CACHE')) {
120
+if (!defined('EBB_APCU_CACHE')) {
121 121
     define('EBB_APCU_CACHE', true);
122 122
 }
123 123
 
124
-if (! defined('EBB_FS_CACHE')) {
124
+if (!defined('EBB_FS_CACHE')) {
125 125
     define('EBB_FS_CACHE', true);
126 126
 }
127 127
 
128
-if (! defined('EBB_DEV_MODE')) {
128
+if (!defined('EBB_DEV_MODE')) {
129 129
     define('EBB_DEV_MODE', false);
130 130
 }
131 131
 
Please login to merge, or discard this patch.
public/themes/winry/templates/0/notices.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 $notices = Notices::getNotices();
14 14
 
15
-if (! empty($notices) && is_array($notices)) : ?>
15
+if (!empty($notices) && is_array($notices)) : ?>
16 16
     <div class="alerts">
17 17
         <?php foreach ($notices as $notice) : ?>
18 18
         <div class="alert alert-<?= $notice->type ?> alert-code-<?= $notice->code ?>" role="alert">
Please login to merge, or discard this patch.
public/themes/winry/templates/0/form-user.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,9 +38,12 @@
 block discarded – undo
38 38
 		<div class="col-sm-2">
39 39
             <?php if ($user->isExists()) : ?>
40 40
             <label for="user_pass"><?= EBB\escHTML(d__('winry', 'New Password')) ?></label>
41
-            <?php else : ?>
41
+            <?php else {
42
+    : ?>
42 43
             <label for="user_pass"><?= EBB\escHTML(d__('winry', 'Password')) ?> <span class="form-required">*</span></label>
43
-            <?php endif; ?>
44
+            <?php endif;
45
+}
46
+?>
44 47
 		</div>
45 48
 		<div class="col-sm-4">
46 49
 			<input type="password" name="user_pass_1" id="user_pass_1" class="form-control" value="" placeholder="<?= EBB\escAttr(d__('winry', 'Type the password')) ?>" autocomplete="off" />
Please login to merge, or discard this patch.
public/themes/winry/templates/0/pagination.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     'page_url' => $view->get('page_url'),
16 16
 ]);
17 17
 
18
-if (! empty($urls)) : ?>
18
+if (!empty($urls)) : ?>
19 19
     <nav>
20 20
         <ul class="pagination">
21 21
             <?php if ($view->get('current') > 1) : ?>
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,9 +30,12 @@
 block discarded – undo
30 30
 
31 31
             <?php if ($number == $view->get('current')) : ?>
32 32
             <li class="active"><span><?= EBB\escHTML(number_format($number)) ?></span></li>
33
-            <?php else : ?>
33
+            <?php else {
34
+    : ?>
34 35
             <li><a href="<?= EBB\escURL($url) ?>"><?= EBB\escHTML(number_format($number)) ?></a></li>
35
-            <?php endif; ?>
36
+            <?php endif;
37
+}
38
+?>
36 39
 
37 40
             <?php endforeach; ?>
38 41
 
Please login to merge, or discard this patch.
public/themes/winry/templates/0/home.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,10 +20,13 @@
 block discarded – undo
20 20
             <?= EBB\getAddCityLink(['content' => EBB\escHTML(d__('winry', 'Add City')), 'atts' => ['class' => 'btn btn-lg btn-default']], $context) ?>
21 21
             <?= EBB\getAddDistrictLink(['content' => EBB\escHTML(d__('winry', 'Add District')), 'atts' => ['class' => 'btn btn-lg btn-default']], $context) ?>
22 22
             <?= EBB\getAddUserLink(['content' => EBB\escHTML(d__('winry', 'Add User')), 'atts' => ['class' => 'btn btn-lg btn-default']], $context) ?>
23
-            <?php else : ?>
23
+            <?php else {
24
+    : ?>
24 25
             <?= EBB\getSignupLink(['atts' => ['class' => 'btn btn-lg btn-primary']]) ?>
25 26
             <?= EBB\getLoginLink(['atts' => ['class' => 'btn btn-lg btn-default']]) ?>
26
-            <?php endif; ?>
27
+            <?php endif;
28
+}
29
+?>
27 30
         </div>
28 31
     </div>
29 32
 
Please login to merge, or discard this patch.
public/themes/winry/templates/0/form-donor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@
 block discarded – undo
11 11
 use EBloodBank\Options;
12 12
 
13 13
 $donorEmailVisibility = $donor->getMeta('email_visibility');
14
-if (empty($donorEmailVisibility) && ! $donor->isExists()) {
14
+if (empty($donorEmailVisibility) && !$donor->isExists()) {
15 15
     $donorEmailVisibility = Options::getOption('default_donor_email_visibility');
16 16
 }
17 17
 
18 18
 $donorPhoneVisibility = $donor->getMeta('phone_visibility');
19
-if (empty($donorPhoneVisibility) && ! $donor->isExists()) {
19
+if (empty($donorPhoneVisibility) && !$donor->isExists()) {
20 20
     $donorPhoneVisibility = Options::getOption('default_donor_phone_visibility');
21 21
 }
22 22
 ?>
Please login to merge, or discard this patch.
public/themes/winry/templates/0/header.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 		<!-- Page Content -->
70 70
 		<div class="container">
71 71
 
72
-            <?php if (! $view->get('page_header.hide')) : ?>
72
+            <?php if (!$view->get('page_header.hide')) : ?>
73 73
             <header class="page-header">
74 74
                 <h1><?= EBB\escHTML($view->isExists('page_header.title') ? $view->get('page_header.title') : $view->get('title')) ?></h1>
75 75
             </header>
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,10 +55,13 @@
 block discarded – undo
55 55
                         <?php if ($currentUser) : ?>
56 56
                         <?= EBB\getEditUserLink(['user' => $currentUser, 'content' => sprintf(d__('winry', 'Hello, <b>%s</b>!'), EBB\escHTML($currentUser->get('name'))), 'before' => '<li>', 'after' => '</li>'], $context) ?>
57 57
                         <?= EBB\getLogoutLink(['before' => '<li>', 'after' => '</li>'], $context) ?>
58
-                        <?php else : ?>
58
+                        <?php else {
59
+    : ?>
59 60
                         <?= EBB\getLoginLink(['content' => EBB\escHTML(d__('winry', 'Anonymous, Log In?')), 'before' => '<li>', 'after' => '</li>'], $context) ?>
60 61
                         <?= EBB\getSignupLink(['before' => '<li>', 'after' => '</li>']) ?>
61
-                        <?php endif; ?>
62
+                        <?php endif;
63
+}
64
+?>
62 65
 					</ul>
63 66
 				</div>
64 67
 				<!-- /.navbar-collapse -->
Please login to merge, or discard this patch.
public/themes/winry/templates/0/view-donor.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 		<?php $donorEmailVisibility = $donor->getMeta('email_visibility') ?>
36 36
 
37
-		<?php if (! $donorEmailVisibility || 'everyone' === $donorEmailVisibility) : ?>
37
+		<?php if (!$donorEmailVisibility || 'everyone' === $donorEmailVisibility) : ?>
38 38
         <dt><?= EBB\escHTML(d__('winry', 'E-mail')) ?></dt>
39 39
         <dd><?= EBB\escHTML($donor->getMeta('email')) ?></dd>
40 40
 		<?php elseif ('members' === $donorEmailVisibility) : ?>
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
 		<?php $donorPhoneVisibility = $donor->getMeta('phone_visibility') ?>
57 57
 
58
-		<?php if (! $donorPhoneVisibility || 'everyone' === $donorPhoneVisibility) : ?>
58
+		<?php if (!$donorPhoneVisibility || 'everyone' === $donorPhoneVisibility) : ?>
59 59
         <dt><?= EBB\escHTML(d__('winry', 'Phone')) ?></dt>
60 60
         <dd><?= EBB\escHTML($donor->getMeta('phone')) ?></dd>
61 61
 		<?php elseif ('members' === $donorPhoneVisibility) : ?>
Please login to merge, or discard this patch.
Braces   +20 added lines, -8 removed lines patch added patch discarded remove patch
@@ -41,16 +41,22 @@  discard block
 block discarded – undo
41 41
         <dt><?= EBB\escHTML(d__('winry', 'E-mail')) ?></dt>
42 42
 		<?php if ($currentUser && $acl->canReadEntity($currentUser, $donor)) : ?>
43 43
         <dd><?= EBB\escHTML($donor->getMeta('email')) ?></dd>
44
-		<?php else : ?>
44
+		<?php else {
45
+    : ?>
45 46
 		<dd><span class="text-warning"><?= EBB\escHTML(d__('winry', 'Only site members can view this donor e-mail address.')) ?></span></dd>
46
-		<?php endif; ?>
47
+		<?php endif;
48
+}
49
+?>
47 50
 		<?php elseif ('staff' === $donorEmailVisibility) : ?>
48 51
         <dt><?= EBB\escHTML(d__('winry', 'E-mail')) ?></dt>
49 52
 		<?php if ($currentUser && $acl->canEditEntity($currentUser, $donor)) : ?>
50 53
         <dd><?= EBB\escHTML($donor->getMeta('email')) ?></dd>
51
-		<?php else : ?>
54
+		<?php else {
55
+    : ?>
52 56
 		<dd><span class="text-warning"><?= EBB\escHTML(d__('winry', 'Only site staff can view this donor e-mail address.')) ?></span></dd>
53
-		<?php endif; ?>
57
+		<?php endif;
58
+}
59
+?>
54 60
 		<?php endif; ?>
55 61
 
56 62
 		<?php $donorPhoneVisibility = $donor->getMeta('phone_visibility') ?>
@@ -62,16 +68,22 @@  discard block
 block discarded – undo
62 68
         <dt><?= EBB\escHTML(d__('winry', 'Phone')) ?></dt>
63 69
 		<?php if ($currentUser && $acl->canReadEntity($currentUser, $donor)) : ?>
64 70
         <dd><?= EBB\escHTML($donor->getMeta('phone')) ?></dd>
65
-		<?php else : ?>
71
+		<?php else {
72
+    : ?>
66 73
 		<dd><span class="text-warning"><?= EBB\escHTML(d__('winry', 'Only site members can view this donor phone number.')) ?></span></dd>
67
-		<?php endif; ?>
74
+		<?php endif;
75
+}
76
+?>
68 77
 		<?php elseif ('staff' === $donorPhoneVisibility) : ?>
69 78
         <dt><?= EBB\escHTML(d__('winry', 'Phone')) ?></dt>
70 79
 		<?php if ($currentUser && $acl->canEditEntity($currentUser, $donor)) : ?>
71 80
         <dd><?= EBB\escHTML($donor->getMeta('phone')) ?></dd>
72
-		<?php else : ?>
81
+		<?php else {
82
+    : ?>
73 83
 		<dd><span class="text-warning"><?= EBB\escHTML(d__('winry', 'Only site staff can view this donor phone number.')) ?></span></dd>
74
-		<?php endif; ?>
84
+		<?php endif;
85
+}
86
+?>
75 87
 		<?php endif; ?>
76 88
 
77 89
         <dt><?= EBB\escHTML(d__('winry', 'City\District')) ?></dt>
Please login to merge, or discard this patch.
src/EBloodBank/Models/City.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     public function isExists()
85 85
     {
86 86
         $id = (int) $this->get('id');
87
-        return ! empty($id);
87
+        return !empty($id);
88 88
     }
89 89
 
90 90
     /**
@@ -127,17 +127,17 @@  discard block
 block discarded – undo
127 127
     {
128 128
         switch ($key) {
129 129
             case 'id':
130
-                if (! EBB\isValidID($value)) {
130
+                if (!EBB\isValidID($value)) {
131 131
                     throw new InvalidArgumentException(__('Invalid city ID.'));
132 132
                 }
133 133
                 break;
134 134
             case 'name':
135
-                if (! is_string($value) || empty($value)) {
135
+                if (!is_string($value) || empty($value)) {
136 136
                     throw new InvalidArgumentException(__('Invalid city name.'));
137 137
                 }
138 138
                 break;
139 139
             case 'created_by':
140
-                if (! $value instanceof User || ! $value->isExists()) {
140
+                if (!$value instanceof User || !$value->isExists()) {
141 141
                     throw new InvalidArgumentException(__('Invalid city originator.'));
142 142
                 }
143 143
                 break;
Please login to merge, or discard this patch.