@@ -33,11 +33,11 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $value = $fallback; |
| 35 | 35 | |
| 36 | - if (! is_array($this->meta)) { |
|
| 36 | + if (!is_array($this->meta)) { |
|
| 37 | 37 | return $value; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - if (! isset($this->meta[$key])) { |
|
| 40 | + if (!isset($this->meta[$key])) { |
|
| 41 | 41 | return $value; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $value = static::sanitizeMeta($key, $value); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - if (! $validate || static::validateMeta($key, $value)) { |
|
| 65 | + if (!$validate || static::validateMeta($key, $value)) { |
|
| 66 | 66 | $this->meta[$key] = $value; |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -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; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | public function isExists() |
| 82 | 82 | { |
| 83 | 83 | $id = (int) $this->get('id'); |
| 84 | - return ! empty($id); |
|
| 84 | + return !empty($id); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -114,19 +114,19 @@ discard block |
||
| 114 | 114 | { |
| 115 | 115 | switch ($key) { |
| 116 | 116 | case 'id': |
| 117 | - if (! EBB\isValidID($value)) { |
|
| 117 | + if (!EBB\isValidID($value)) { |
|
| 118 | 118 | throw new InvalidArgumentException(__('Invalid city ID.')); |
| 119 | 119 | } |
| 120 | 120 | break; |
| 121 | 121 | case 'name': |
| 122 | - if (! is_string($value) || empty($value)) { |
|
| 122 | + if (!is_string($value) || empty($value)) { |
|
| 123 | 123 | throw new InvalidArgumentException(__('Invalid city name.')); |
| 124 | 124 | } |
| 125 | 125 | break; |
| 126 | 126 | case 'created_at': |
| 127 | 127 | break; |
| 128 | 128 | case 'created_by': |
| 129 | - if (! $value instanceof User || ! $value->isExists()) { |
|
| 129 | + if (!$value instanceof User || !$value->isExists()) { |
|
| 130 | 130 | throw new InvalidArgumentException(__('Invalid city originator.')); |
| 131 | 131 | } |
| 132 | 132 | break; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | public function isExists() |
| 81 | 81 | { |
| 82 | 82 | $id = (int) $this->get('id'); |
| 83 | - return ! empty($id); |
|
| 83 | + return !empty($id); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -117,24 +117,24 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | switch ($key) { |
| 119 | 119 | case 'id': |
| 120 | - if (! EBB\isValidID($value)) { |
|
| 120 | + if (!EBB\isValidID($value)) { |
|
| 121 | 121 | throw new InvalidArgumentException(__('Invalid district ID.')); |
| 122 | 122 | } |
| 123 | 123 | break; |
| 124 | 124 | case 'name': |
| 125 | - if (! is_string($value) || empty($value)) { |
|
| 125 | + if (!is_string($value) || empty($value)) { |
|
| 126 | 126 | throw new InvalidArgumentException(__('Invalid district name.')); |
| 127 | 127 | } |
| 128 | 128 | break; |
| 129 | 129 | case 'city': |
| 130 | - if (! $value instanceof City || ! $value->isExists()) { |
|
| 130 | + if (!$value instanceof City || !$value->isExists()) { |
|
| 131 | 131 | throw new InvalidArgumentException(__('Invalid district city.')); |
| 132 | 132 | } |
| 133 | 133 | break; |
| 134 | 134 | case 'created_at': |
| 135 | 135 | break; |
| 136 | 136 | case 'created_by': |
| 137 | - if (! $value instanceof User || ! $value->isExists()) { |
|
| 137 | + if (!$value instanceof User || !$value->isExists()) { |
|
| 138 | 138 | throw new InvalidArgumentException(__('Invalid district originator.')); |
| 139 | 139 | } |
| 140 | 140 | 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 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | public function isExists() |
| 138 | 138 | { |
| 139 | 139 | $id = (int) $this->get('id'); |
| 140 | - return ! empty($id); |
|
| 140 | + return !empty($id); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -228,41 +228,41 @@ discard block |
||
| 228 | 228 | { |
| 229 | 229 | switch ($key) { |
| 230 | 230 | case 'id': |
| 231 | - if (! EBB\isValidID($value)) { |
|
| 231 | + if (!EBB\isValidID($value)) { |
|
| 232 | 232 | throw new InvalidArgumentException(__('Invalid donor ID.')); |
| 233 | 233 | } |
| 234 | 234 | break; |
| 235 | 235 | case 'name': |
| 236 | - if (! is_string($value) || empty($value)) { |
|
| 236 | + if (!is_string($value) || empty($value)) { |
|
| 237 | 237 | throw new InvalidArgumentException(__('Invalid donor name.')); |
| 238 | 238 | } |
| 239 | 239 | break; |
| 240 | 240 | case 'gender': |
| 241 | - if (! array_key_exists($value, EBB\getGenders())) { |
|
| 241 | + if (!array_key_exists($value, EBB\getGenders())) { |
|
| 242 | 242 | throw new InvalidArgumentException(__('Invalid donor gender.')); |
| 243 | 243 | } |
| 244 | 244 | break; |
| 245 | 245 | case 'birthdate': |
| 246 | 246 | break; |
| 247 | 247 | case 'blood_group': |
| 248 | - if (! in_array($value, EBB\getBloodGroups(), true)) { |
|
| 248 | + if (!in_array($value, EBB\getBloodGroups(), true)) { |
|
| 249 | 249 | throw new InvalidArgumentException(__('Invalid donor blood group.')); |
| 250 | 250 | } |
| 251 | 251 | break; |
| 252 | 252 | case 'district': |
| 253 | - if (! $value instanceof District || ! $value->isExists()) { |
|
| 253 | + if (!$value instanceof District || !$value->isExists()) { |
|
| 254 | 254 | throw new InvalidArgumentException(__('Invalid donor district.')); |
| 255 | 255 | } |
| 256 | 256 | break; |
| 257 | 257 | case 'created_at': |
| 258 | 258 | break; |
| 259 | 259 | case 'created_by': |
| 260 | - if (! $value instanceof User || ! $value->isExists()) { |
|
| 260 | + if (!$value instanceof User || !$value->isExists()) { |
|
| 261 | 261 | throw new InvalidArgumentException(__('Invalid donor originator.')); |
| 262 | 262 | } |
| 263 | 263 | break; |
| 264 | 264 | case 'status': |
| 265 | - if (! is_string($value) || empty($value)) { |
|
| 265 | + if (!is_string($value) || empty($value)) { |
|
| 266 | 266 | throw new InvalidArgumentException(__('Invalid donor status.')); |
| 267 | 267 | } |
| 268 | 268 | break; |
@@ -305,28 +305,28 @@ discard block |
||
| 305 | 305 | { |
| 306 | 306 | switch ($key) { |
| 307 | 307 | case 'weight': |
| 308 | - if (! empty($value) && ! EBB\isValidFloat($value)) { |
|
| 308 | + if (!empty($value) && !EBB\isValidFloat($value)) { |
|
| 309 | 309 | // TODO: Check Min and Max weight. |
| 310 | 310 | throw new InvalidArgumentException(__('Invalid donor weight.')); |
| 311 | 311 | } |
| 312 | 312 | break; |
| 313 | 313 | case 'email': |
| 314 | - if (! empty($value) && ! EBB\isValidEmail($value)) { |
|
| 314 | + if (!empty($value) && !EBB\isValidEmail($value)) { |
|
| 315 | 315 | throw new InvalidArgumentException(__('Invalid donor e-mail address.')); |
| 316 | 316 | } |
| 317 | 317 | break; |
| 318 | 318 | case 'email_visibility': |
| 319 | - if (! empty($value) && ! array_key_exists($value, EBB\getVisibilities())) { |
|
| 319 | + if (!empty($value) && !array_key_exists($value, EBB\getVisibilities())) { |
|
| 320 | 320 | throw new InvalidArgumentException(__('Invalid donor e-mail address visibility.')); |
| 321 | 321 | } |
| 322 | 322 | break; |
| 323 | 323 | case 'phone': |
| 324 | - if (! empty($value) && ! ctype_digit($value)) { |
|
| 324 | + if (!empty($value) && !ctype_digit($value)) { |
|
| 325 | 325 | throw new InvalidArgumentException(__('Invalid donor phone number.')); |
| 326 | 326 | } |
| 327 | 327 | break; |
| 328 | 328 | case 'phone_visibility': |
| 329 | - if (! empty($value) && ! array_key_exists($value, EBB\getVisibilities())) { |
|
| 329 | + if (!empty($value) && !array_key_exists($value, EBB\getVisibilities())) { |
|
| 330 | 330 | throw new InvalidArgumentException(__('Invalid donor phone number visibility.')); |
| 331 | 331 | } |
| 332 | 332 | break; |
@@ -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) { |