FluxBB\Core\Validator::ensureAllInRules PHP Method

ensureAllInRules() protected method

Make sure all of the keys of the given array exist in our ruleset.
protected ensureAllInRules ( array $data )
$data array
    protected function ensureAllInRules(array $data)
    {
        $rules = $this->rules();
        $invalid = array_diff_key($data, $rules);
        if (!empty($invalid)) {
            throw new ValidationFailed(new MessageBag(['Invalid keys found in request.']));
        }
        return $this;
    }