18 if (self::$constCacheArray == NULL) {
19 self::$constCacheArray = [];
21 $calledClass = get_called_class();
22 if (! \array_key_exists($calledClass, self::$constCacheArray)) {
23 $reflect = new \ReflectionClass($calledClass);
24 self::$constCacheArray[$calledClass] = $reflect->getConstants();
26 return self::$constCacheArray[$calledClass];
63 $count = \count($values);
64 $calledClass = \get_called_class();
65 if ($unique && $count > count(self::$picked[$calledClass] ?? [])) {
67 $newVal = $values[\rand(0, $count - 1)];
68 }
while (isset(self::$picked[$calledClass][$newVal]));
69 self::$picked[$calledClass][$newVal] =
true;
72 return $values[\rand(0, $count - 1)];