protected function preCheckedEnum($subject, array $allowedValues) : bool
    {
        if ($subject !== null && !is_scalar($subject)) {
            return false;
        }
        foreach ($allowedValues as $allowed) {
            if ($subject === $allowed) {
                return true;
            }
        }
        return false;
    }
protected function preCheckedEnum($subject, array $allowedValues) : bool
    {
        if ($subject !== null && !is_scalar($subject)) {
            return false;
        }
        foreach ($allowedValues as $allowed) {
            if ($subject === $allowed) {
                return true;
            }
        }
        return false;
    }
protected function preCheckedEnum ( $ subject , array $ allowedValues ) : bool { if ( $ subject !== null && ! is_scalar ( $ subject ) ) { return false ; } foreach ( $ allowedValues as $ allowed ) { if ( $ subject === $ allowed ) { return true ; } } return false ; }
Enum rule method which doesn't check that all allowed values
are scalar|null; ValidationRuleSet checks that.



@see Validate::enum()

@param mixed $subject
@param array $allowedValues

@return bool
Enum rule method which doesn t check that all allowed values are scalar|null ; ValidationRuleSet checks that .