public function checkRules(array $rules, Request $request, ?string $component = null): void
    {
        foreach ($rules as $rule) {
            $class = get_class($rule);
            $handler = ($this->handlerResolver)($class);
            if (!$handler instanceof RuleHandlerInterface) {
                throw new UnexpectedTypeException("No rule handler found for type '$class'.");
            }
            $handler->checkRule($rule, $request, $component);
        }
    }