@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $var = $em->find('Entities:Variable', $name); |
| 44 | 44 | |
| 45 | - if (! empty($var)) { |
|
| 45 | + if (!empty($var)) { |
|
| 46 | 46 | return $var->get('value'); |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $value = self::sanitizeOption($name, $value); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - if ($validate && ! self::validateOption($name, $value)) { |
|
| 63 | + if ($validate && !self::validateOption($name, $value)) { |
|
| 64 | 64 | return false; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | $var = $em->find('Entities:Variable', $name); |
| 74 | 74 | |
| 75 | - if (! empty($var)) { |
|
| 75 | + if (!empty($var)) { |
|
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $value = self::sanitizeOption($name, $value); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - if ($validate && ! self::validateOption($name, $value)) { |
|
| 102 | + if ($validate && !self::validateOption($name, $value)) { |
|
| 103 | 103 | return false; |
| 104 | 104 | } |
| 105 | 105 | |
@@ -218,24 +218,24 @@ discard block |
||
| 218 | 218 | /* Site Options */ |
| 219 | 219 | |
| 220 | 220 | case 'site_url': |
| 221 | - if (empty($value) || ! isValidURL($value)) { |
|
| 221 | + if (empty($value) || !isValidURL($value)) { |
|
| 222 | 222 | throw new InvalidArgumentException(__('Invalid site URL.')); |
| 223 | 223 | } |
| 224 | 224 | break; |
| 225 | 225 | case 'site_name': |
| 226 | - if (empty($value) || ! is_string($value)) { |
|
| 226 | + if (empty($value) || !is_string($value)) { |
|
| 227 | 227 | throw new InvalidArgumentException(__('Invalid site name.')); |
| 228 | 228 | } |
| 229 | 229 | break; |
| 230 | 230 | case 'site_slogan': |
| 231 | 231 | break; |
| 232 | 232 | case 'site_email': |
| 233 | - if (empty($value) || ! isValidEmail($value)) { |
|
| 233 | + if (empty($value) || !isValidEmail($value)) { |
|
| 234 | 234 | throw new InvalidArgumentException(__('Invalid site e-mail address.')); |
| 235 | 235 | } |
| 236 | 236 | break; |
| 237 | 237 | case 'site_locale': |
| 238 | - if (! empty($value)) { |
|
| 238 | + if (!empty($value)) { |
|
| 239 | 239 | $locale = Locales::findLocale($value); |
| 240 | 240 | if (empty($locale)) { |
| 241 | 241 | throw new InvalidArgumentException(__('Could not find the locale.')); |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | break; |
| 245 | 245 | case 'site_theme': |
| 246 | - if (! empty($value)) { |
|
| 246 | + if (!empty($value)) { |
|
| 247 | 247 | $theme = Themes::findTheme($value); |
| 248 | 248 | if (empty($theme)) { |
| 249 | 249 | throw new InvalidArgumentException(__('Could not find the theme.')); |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | /* Users Options */ |
| 255 | 255 | |
| 256 | 256 | case 'self_registration': |
| 257 | - if (empty($value) || ! in_array($value, ['on', 'off'])) { |
|
| 257 | + if (empty($value) || !in_array($value, ['on', 'off'])) { |
|
| 258 | 258 | throw new InvalidArgumentException(__('Invalid self-registration status.')); |
| 259 | 259 | } |
| 260 | 260 | break; |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | } |
| 265 | 265 | break; |
| 266 | 266 | case 'new_user_status': |
| 267 | - if (empty($value) || ! in_array($value, ['pending', 'activated'])) { |
|
| 267 | + if (empty($value) || !in_array($value, ['pending', 'activated'])) { |
|
| 268 | 268 | throw new InvalidArgumentException(__('Invalid new user status.')); |
| 269 | 269 | } |
| 270 | 270 | break; |
@@ -272,13 +272,13 @@ discard block |
||
| 272 | 272 | /* Donors Options */ |
| 273 | 273 | |
| 274 | 274 | case 'default_donor_email_visibility': |
| 275 | - if (! empty($value) && ! array_key_exists($value, getVisibilities())) { |
|
| 275 | + if (!empty($value) && !array_key_exists($value, getVisibilities())) { |
|
| 276 | 276 | throw new InvalidArgumentException(__('Invalid donor e-mail address visibility.')); |
| 277 | 277 | } |
| 278 | 278 | break; |
| 279 | 279 | |
| 280 | 280 | case 'default_donor_phone_visibility': |
| 281 | - if (! empty($value) && ! array_key_exists($value, getVisibilities())) { |
|
| 281 | + if (!empty($value) && !array_key_exists($value, getVisibilities())) { |
|
| 282 | 282 | throw new InvalidArgumentException(__('Invalid donor phone number visibility.')); |
| 283 | 283 | } |
| 284 | 284 | break; |
@@ -286,12 +286,12 @@ discard block |
||
| 286 | 286 | /* Reading Options */ |
| 287 | 287 | |
| 288 | 288 | case 'site_publication': |
| 289 | - if (empty($value) || ! in_array($value, ['on', 'off'])) { |
|
| 289 | + if (empty($value) || !in_array($value, ['on', 'off'])) { |
|
| 290 | 290 | throw new InvalidArgumentException(__('Invalid site publication status.')); |
| 291 | 291 | } |
| 292 | 292 | break; |
| 293 | 293 | case 'entities_per_page': |
| 294 | - if (empty($value) || ! isValidInteger($value) || $value < 1) { |
|
| 294 | + if (empty($value) || !isValidInteger($value) || $value < 1) { |
|
| 295 | 295 | throw new InvalidArgumentException(__('Invalid entities per page count.')); |
| 296 | 296 | } |
| 297 | 297 | break; |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | if ($context) { |
| 29 | 29 | $currentUser = $context->get('currentUser'); |
| 30 | 30 | |
| 31 | - if (! $currentUser || ! $context->getAcl()->isUserAllowed($currentUser, 'User', 'activate')) { |
|
| 31 | + if (!$currentUser || !$context->getAcl()->isUserAllowed($currentUser, 'User', 'activate')) { |
|
| 32 | 32 | return $badge; |
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if (! isset($args['atts']['class'])) { |
|
| 36 | + if (!isset($args['atts']['class'])) { |
|
| 37 | 37 | $args['atts']['class'] = 'badge pending-users-badge'; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | if ($context) { |
| 68 | 68 | $currentUser = $context->get('currentUser'); |
| 69 | 69 | |
| 70 | - if (! $currentUser || ! $context->getAcl()->isUserAllowed($currentUser, 'Donor', 'approve')) { |
|
| 70 | + if (!$currentUser || !$context->getAcl()->isUserAllowed($currentUser, 'Donor', 'approve')) { |
|
| 71 | 71 | return $badge; |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if (! isset($args['atts']['class'])) { |
|
| 75 | + if (!isset($args['atts']['class'])) { |
|
| 76 | 76 | $args['atts']['class'] = 'badge pending-donors-badge'; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public function isExists() |
| 46 | 46 | { |
| 47 | 47 | $id = (int) $this->get('id'); |
| 48 | - return ! empty($id); |
|
| 48 | + return !empty($id); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | { |
| 76 | 76 | switch ($key) { |
| 77 | 77 | case 'name': |
| 78 | - if (! is_string($value) || empty($value)) { |
|
| 78 | + if (!is_string($value) || empty($value)) { |
|
| 79 | 79 | throw new InvalidArgumentException(__('Invalid variable name.')); |
| 80 | 80 | } |
| 81 | 81 | break; |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | if ($sanitize) { |
| 89 | 89 | $value = static::sanitize($key, $value); |
| 90 | 90 | } |
| 91 | - if (! $validate || static::validate($key, $value)) { |
|
| 91 | + if (!$validate || static::validate($key, $value)) { |
|
| 92 | 92 | $this->$key = $value; |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -105,12 +105,12 @@ |
||
| 105 | 105 | } elseif (EBB\isValidID($criteria['city'])) { |
| 106 | 106 | $em = $this->getEntityManager(); |
| 107 | 107 | $city = $em->find('Entities:City', $criteria['city']); |
| 108 | - if (! empty($city)) { |
|
| 108 | + if (!empty($city)) { |
|
| 109 | 109 | $districts = $city->get('districts'); |
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - if (! empty($districts)) { |
|
| 113 | + if (!empty($districts)) { |
|
| 114 | 114 | $criteria['district'] = []; |
| 115 | 115 | |
| 116 | 116 | foreach ($districts as $district) { |
@@ -125,11 +125,11 @@ |
||
| 125 | 125 | static $status; |
| 126 | 126 | |
| 127 | 127 | if (is_null($status) || $forceCheck) { |
| 128 | - if (! isDatabaseSelected($connection)) { |
|
| 128 | + if (!isDatabaseSelected($connection)) { |
|
| 129 | 129 | $status = DATABASE_NOT_SELECTED; |
| 130 | - } elseif (! isDatabaseConnected($connection)) { |
|
| 130 | + } elseif (!isDatabaseConnected($connection)) { |
|
| 131 | 131 | $status = DATABASE_NOT_CONNECTED; |
| 132 | - } elseif (! isAnyTablesExists($connection)) { |
|
| 132 | + } elseif (!isAnyTablesExists($connection)) { |
|
| 133 | 133 | $status = DATABASE_TABLE_NOT_EXIST; |
| 134 | 134 | } else { |
| 135 | 135 | $status = DATABASE_INSTALLED; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $args['selected'] = (array) $args['selected']; |
| 64 | 64 | |
| 65 | - array_walk($args['selected'], function ($value) { |
|
| 65 | + array_walk($args['selected'], function($value) { |
|
| 66 | 66 | if ($value instanceof User) { |
| 67 | 67 | return $value->get('id'); |
| 68 | 68 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $args['selected'] = (array) $args['selected']; |
| 129 | 129 | |
| 130 | - array_walk($args['selected'], function ($value) { |
|
| 130 | + array_walk($args['selected'], function($value) { |
|
| 131 | 131 | if ($value instanceof City) { |
| 132 | 132 | return $value->get('id'); |
| 133 | 133 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | $args['selected'] = (array) $args['selected']; |
| 195 | 195 | |
| 196 | - array_walk($args['selected'], function ($value) { |
|
| 196 | + array_walk($args['selected'], function($value) { |
|
| 197 | 197 | if ($value instanceof District) { |
| 198 | 198 | return $value->get('id'); |
| 199 | 199 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | ); |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - if (! $args['group_by_cities']) { |
|
| 223 | + if (!$args['group_by_cities']) { |
|
| 224 | 224 | foreach ($args['districts'] as $district) { |
| 225 | 225 | $districtID = (int) $district->get('id'); |
| 226 | 226 | $output .= sprintf( |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | foreach ($args['districts'] as $district) { |
| 239 | 239 | $city = $district->get('city'); |
| 240 | 240 | $cityID = (int) $city->get('id'); |
| 241 | - if (! isset($groups[$cityID])) { |
|
| 241 | + if (!isset($groups[$cityID])) { |
|
| 242 | 242 | $groups[$cityID] = [ |
| 243 | 243 | 'atts' => [ |
| 244 | 244 | 'label' => $city->get('name') |
@@ -256,10 +256,10 @@ discard block |
||
| 256 | 256 | 'text' => $district->get('name'), |
| 257 | 257 | ]; |
| 258 | 258 | } |
| 259 | - if (! empty($groups)) { |
|
| 259 | + if (!empty($groups)) { |
|
| 260 | 260 | foreach ($groups as $group) { |
| 261 | 261 | $output .= sprintf('<optgroup%s>', toAttributes($group['atts'])); |
| 262 | - if (! empty($group['options']) && is_array($group['options'])) { |
|
| 262 | + if (!empty($group['options']) && is_array($group['options'])) { |
|
| 263 | 263 | foreach ($group['options'] as $option) { |
| 264 | 264 | $output .= sprintf( |
| 265 | 265 | '<option%s>%s</option>', |
@@ -72,19 +72,19 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function __construct($code, $moFile, $poFile = '') |
| 74 | 74 | { |
| 75 | - if (! empty($code) && strlen($code) >= 2) { |
|
| 75 | + if (!empty($code) && strlen($code) >= 2) { |
|
| 76 | 76 | $this->code = $code; |
| 77 | 77 | } else { |
| 78 | 78 | throw new InvalidArgumentException(__('Invalid locale code.')); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - if (! empty($moFile) && is_readable($moFile)) { |
|
| 81 | + if (!empty($moFile) && is_readable($moFile)) { |
|
| 82 | 82 | $this->moFilePath = $moFile; |
| 83 | 83 | } else { |
| 84 | 84 | throw new InvalidArgumentException(__('Locale MO file is not readable or not exists.')); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - if (! empty($poFile)) { |
|
| 87 | + if (!empty($poFile)) { |
|
| 88 | 88 | if (is_readable($poFile)) { |
| 89 | 89 | $this->poFilePath = $poFile; |
| 90 | 90 | } else { |
@@ -159,9 +159,9 @@ discard block |
||
| 159 | 159 | if (is_null($this->languageCode)) { |
| 160 | 160 | $translations = $this->getTranslations(); |
| 161 | 161 | |
| 162 | - if (! empty($translations)) { |
|
| 162 | + if (!empty($translations)) { |
|
| 163 | 163 | $translation = $translations->find('language code', 'en'); |
| 164 | - if (! empty($translation) && $translation->hasTranslation()) { |
|
| 164 | + if (!empty($translation) && $translation->hasTranslation()) { |
|
| 165 | 165 | $this->languageCode = $translation->getTranslation(); |
| 166 | 166 | } elseif ($translations->hasLanguage()) { |
| 167 | 167 | $this->languageCode = $translations->getLanguage(); |
@@ -183,9 +183,9 @@ discard block |
||
| 183 | 183 | if (is_null($this->textDirection)) { |
| 184 | 184 | $translations = $this->getTranslations(); |
| 185 | 185 | |
| 186 | - if (! empty($translations)) { |
|
| 186 | + if (!empty($translations)) { |
|
| 187 | 187 | $translation = $translations->find('text direction', 'ltr'); |
| 188 | - if (! empty($translation) && $translation->hasTranslation()) { |
|
| 188 | + if (!empty($translation) && $translation->hasTranslation()) { |
|
| 189 | 189 | $this->textDirection = $translation->getTranslation(); |
| 190 | 190 | } |
| 191 | 191 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public static function addNotice($code, $msg, $type = 'warning') |
| 80 | 80 | { |
| 81 | - if (! $code || self::isExists($code)) { |
|
| 81 | + if (!$code || self::isExists($code)) { |
|
| 82 | 82 | return false; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public static function removeNotice($code) |
| 102 | 102 | { |
| 103 | - if (! $code || ! self::isExists($code)) { |
|
| 103 | + if (!$code || !self::isExists($code)) { |
|
| 104 | 104 | return false; |
| 105 | 105 | } |
| 106 | 106 | |