@@ -190,6 +190,11 @@ discard block |
||
| 190 | 190 | * variantFor, in which case we want to perform some certain |
| 191 | 191 | * sanity checks to make sure the code is being used correctly. |
| 192 | 192 | */ |
| 193 | + |
|
| 194 | + /** |
|
| 195 | + * @param integer $userId |
|
| 196 | + * @param boolean $inVariantMethod |
|
| 197 | + */ |
|
| 193 | 198 | private function chooseVariant($bucketingId, $userId, $inVariantMethod) |
| 194 | 199 | { |
| 195 | 200 | if ($inVariantMethod && $this->enabled === self::ON) { |
@@ -362,6 +367,10 @@ discard block |
||
| 362 | 367 | * should see each variant to map a randomish number to a |
| 363 | 368 | * particular variant. |
| 364 | 369 | */ |
| 370 | + |
|
| 371 | + /** |
|
| 372 | + * @param string $id |
|
| 373 | + */ |
|
| 365 | 374 | private function variantByPercentage($id) |
| 366 | 375 | { |
| 367 | 376 | $n = 100 * $this->randomish($id); |
@@ -447,6 +456,10 @@ discard block |
||
| 447 | 456 | * feature's config stanza, returning an array mappinng the user |
| 448 | 457 | * or group names to they variant they should see. |
| 449 | 458 | */ |
| 459 | + |
|
| 460 | + /** |
|
| 461 | + * @param string $what |
|
| 462 | + */ |
|
| 450 | 463 | private function parseUsersOrGroups($stanza, $what) |
| 451 | 464 | { |
| 452 | 465 | $value = Util::arrayGet($stanza, $what); |
@@ -487,6 +500,10 @@ discard block |
||
| 487 | 500 | * properties. If non-falsy, must be one of the keys in the |
| 488 | 501 | * enabled map unless enabled is 'on' or 'off'. |
| 489 | 502 | */ |
| 503 | + |
|
| 504 | + /** |
|
| 505 | + * @param string $what |
|
| 506 | + */ |
|
| 490 | 507 | private function parseVariantName($stanza, $what) |
| 491 | 508 | { |
| 492 | 509 | $value = Util::arrayGet($stanza, $what); |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | class Util |
| 11 | 11 | { |
| 12 | 12 | /** |
| 13 | - * @return float |
|
| 13 | + * @return integer |
|
| 14 | 14 | */ |
| 15 | 15 | public static function random() |
| 16 | 16 | { |
@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * @param $id |
|
| 22 | - * @return float |
|
| 21 | + * @param string $id |
|
| 22 | + * @return integer |
|
| 23 | 23 | */ |
| 24 | 24 | public static function randomById($id) |
| 25 | 25 | { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * @param string $hex |
| 42 | - * @return float |
|
| 42 | + * @return integer |
|
| 43 | 43 | */ |
| 44 | 44 | private static function mapHex($hex) |
| 45 | 45 | { |