public function enum($subject, array $allowedValues) : bool
    {
        if (!$allowedValues) {
            throw new InvalidArgumentException('Arg allowedValues is empty.');
        }
        if ($subject !== null && !is_scalar($subject)) {
            return false;
        }
        $i = -1;
        foreach ($allowedValues as $allowed) {
            ++$i;
            if ($allowed !== null && !is_scalar($allowed)) {
                throw new InvalidArgumentException(
                    'Arg allowedValues bucket ' . $i . ' type[' . Utils::getType($allowed) . '] is not scalar or null.'
                );
            }
            if ($subject === $allowed) {
                return true;
            }
        }
        return false;
    }