@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | const BUCKETING = 'bucketing'; |
| 23 | 23 | |
| 24 | 24 | /* Special values for enabled property. */ |
| 25 | - const ON = 'on'; /* Feature is fully enabled. */ |
|
| 25 | + const ON = 'on'; /* Feature is fully enabled. */ |
|
| 26 | 26 | const OFF = 'off'; /* Feature is fully disabled. */ |
| 27 | 27 | |
| 28 | 28 | /* Bucketing schemes. */ |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | ); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | - $bucketingId = (string)$bucketingId; |
|
| 212 | + $bucketingId = (string) $bucketingId; |
|
| 213 | 213 | if (array_key_exists($bucketingId, $this->cache)) { |
| 214 | 214 | // Note that this caching is not just an optimization: |
| 215 | 215 | // it prevents us from double logging a single |
@@ -223,13 +223,7 @@ discard block |
||
| 223 | 223 | return $this->cache[$bucketingId]; |
| 224 | 224 | } else { |
| 225 | 225 | list($v, $selector) = |
| 226 | - $this->variantFromURL($userId) ?: |
|
| 227 | - $this->variantForUser($userId) ?: |
|
| 228 | - $this->variantForGroup($userId) ?: |
|
| 229 | - $this->variantForAdmin($userId) ?: |
|
| 230 | - $this->variantForInternal() ?: |
|
| 231 | - $this->variantByPercentage($bucketingId) ?: |
|
| 232 | - array(self::OFF, 'w'); |
|
| 226 | + $this->variantFromURL($userId) ?: $this->variantForUser($userId) ?: $this->variantForGroup($userId) ?: $this->variantForAdmin($userId) ?: $this->variantForInternal() ?: $this->variantByPercentage($bucketingId) ?: array(self::OFF, 'w'); |
|
| 233 | 227 | |
| 234 | 228 | if ($inVariantMethod && $v === self::OFF) { |
| 235 | 229 | $this->error("Variant check outside enabled check"); |
@@ -465,8 +459,7 @@ discard block |
||
| 465 | 459 | } elseif (is_array($value)) { |
| 466 | 460 | $result = array(); |
| 467 | 461 | $bad_keys = is_array($this->enabled) ? |
| 468 | - array_keys(array_diff_key($value, $this->enabled)) : |
|
| 469 | - array(); |
|
| 462 | + array_keys(array_diff_key($value, $this->enabled)) : array(); |
|
| 470 | 463 | if (!$bad_keys) { |
| 471 | 464 | foreach ($value as $variant => $whos) { |
| 472 | 465 | foreach (self::asArray($whos) as $who) { |