@@ -27,7 +27,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -12,7 +12,7 @@ |
||
| 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"> |
@@ -15,7 +15,7 @@ |
||
| 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) : ?> |
@@ -11,12 +11,12 @@ |
||
| 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 | ?> |
@@ -69,7 +69,7 @@ |
||
| 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> |
@@ -34,7 +34,7 @@ discard block |
||
| 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 |
||
| 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) : ?> |
@@ -84,7 +84,7 @@ discard block |
||
| 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 |
||
| 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; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | public function isExists() |
| 117 | 117 | { |
| 118 | 118 | $id = (int) $this->get('id'); |
| 119 | - return ! empty($id); |
|
| 119 | + return !empty($id); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -185,32 +185,32 @@ discard block |
||
| 185 | 185 | { |
| 186 | 186 | switch ($key) { |
| 187 | 187 | case 'id': |
| 188 | - if (! EBB\isValidID($value)) { |
|
| 188 | + if (!EBB\isValidID($value)) { |
|
| 189 | 189 | throw new InvalidArgumentException(__('Invalid user ID.')); |
| 190 | 190 | } |
| 191 | 191 | break; |
| 192 | 192 | case 'name': |
| 193 | - if (! is_string($value) || empty($value)) { |
|
| 193 | + if (!is_string($value) || empty($value)) { |
|
| 194 | 194 | throw new InvalidArgumentException(__('Invalid user name.')); |
| 195 | 195 | } |
| 196 | 196 | break; |
| 197 | 197 | case 'email': |
| 198 | - if (! EBB\isValidEmail($value)) { |
|
| 198 | + if (!EBB\isValidEmail($value)) { |
|
| 199 | 199 | throw new InvalidArgumentException(__('Invalid user e-mail.')); |
| 200 | 200 | } |
| 201 | 201 | break; |
| 202 | 202 | case 'pass': |
| 203 | - if (! is_string($value) || empty($value)) { |
|
| 203 | + if (!is_string($value) || empty($value)) { |
|
| 204 | 204 | throw new InvalidArgumentException(__('Invalid user password.')); |
| 205 | 205 | } |
| 206 | 206 | break; |
| 207 | 207 | case 'role': |
| 208 | - if (! is_string($value)) { |
|
| 208 | + if (!is_string($value)) { |
|
| 209 | 209 | throw new InvalidArgumentException(__('Invalid user role.')); |
| 210 | 210 | } |
| 211 | 211 | break; |
| 212 | 212 | case 'status': |
| 213 | - if (! is_string($value) || empty($value)) { |
|
| 213 | + if (!is_string($value) || empty($value)) { |
|
| 214 | 214 | throw new InvalidArgumentException(__('Invalid user status.')); |
| 215 | 215 | } |
| 216 | 216 | break; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | public function isExists() |
| 84 | 84 | { |
| 85 | 85 | $id = (int) $this->get('id'); |
| 86 | - return ! empty($id); |
|
| 86 | + return !empty($id); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -126,22 +126,22 @@ discard block |
||
| 126 | 126 | { |
| 127 | 127 | switch ($key) { |
| 128 | 128 | case 'id': |
| 129 | - if (! EBB\isValidID($value)) { |
|
| 129 | + if (!EBB\isValidID($value)) { |
|
| 130 | 130 | throw new InvalidArgumentException(__('Invalid district ID.')); |
| 131 | 131 | } |
| 132 | 132 | break; |
| 133 | 133 | case 'name': |
| 134 | - if (! is_string($value) || empty($value)) { |
|
| 134 | + if (!is_string($value) || empty($value)) { |
|
| 135 | 135 | throw new InvalidArgumentException(__('Invalid district name.')); |
| 136 | 136 | } |
| 137 | 137 | break; |
| 138 | 138 | case 'city': |
| 139 | - if (! $value instanceof City || ! $value->isExists()) { |
|
| 139 | + if (!$value instanceof City || !$value->isExists()) { |
|
| 140 | 140 | throw new InvalidArgumentException(__('Invalid district city.')); |
| 141 | 141 | } |
| 142 | 142 | break; |
| 143 | 143 | case 'created_by': |
| 144 | - if (! $value instanceof User || ! $value->isExists()) { |
|
| 144 | + if (!$value instanceof User || !$value->isExists()) { |
|
| 145 | 145 | throw new InvalidArgumentException(__('Invalid district originator.')); |
| 146 | 146 | } |
| 147 | 147 | break; |