src/Validator.php
public function inArray($field_name, array $array_of_values, $allow_null = false)
    {
        if (empty($field_name)) {
            throw new InvalidArgumentException("Value '$field_name' is not a valid field name");
        }

        if (array_key_exists($field_name, $this->field_values)) {
            if ($this->field_values[$field_name] === null) {
                if ($allow_null) {
                    return true;
                } else {
                    return $this->failPresenceValidation($field_name);
                }
            }

            if (in_array($this->field_values[$field_name], $array_of_values)) {
                return true;
            } else {
                $this->addFieldError($field_name, "Value of '$field_name' is not present in the list of supported values");

                return false;
            }
        } else {
            return $this->failPresenceValidation($field_name);
        }
    }
public function inArray($field_name, array $array_of_values, $allow_null = false)
    {
        if (empty($field_name)) {
            throw new InvalidArgumentException("Value '$field_name' is not a valid field name");
        }

        if (array_key_exists($field_name, $this->field_values)) {
            if ($this->field_values[$field_name] === null) {
                if ($allow_null) {
                    return true;
                } else {
                    return $this->failPresenceValidation($field_name);
                }
            }

            if (in_array($this->field_values[$field_name], $array_of_values)) {
                return true;
            } else {
                $this->addFieldError($field_name, "Value of '$field_name' is not present in the list of supported values");

                return false;
            }
        } else {
            return $this->failPresenceValidation($field_name);
        }
    }
{@inheritdoc}