protected function createChainableValidators(RespectValidator $class, array $rules): RespectValidator
    {
        // reset keys
        $rules = \array_values($rules);

        if (\count($rules) !== 0) {
            $chain = '';

            foreach ($rules as $rule) {
                if ($rules[0] === $rule) {
                    $chain .= $rule;
                } else {
                    $chain .= '.' . $rule;
                }
            }

            return \array_reduce(\explode('.', $chain), function (object $validator, string $method) {
                [$method, $parameters] = $this->parseStringRule($method);
                $method                = \str_replace(['!', '?'], '', $method);

                return $validator->{$method}(...$parameters);
            }, $class);
        }

        return $class;
    }