protected function createRule(string $className, array $args = [])
    {
        if (!class_exists($className)) {
            throw new InvalidArgumentException("Class \"$className\" does not exist");
        }

        /** @var IRule|IRuleWithArgs $rule */
        $rule = new $className;

        if ($rule instanceof IRuleWithArgs) {
            $rule->setArgs($args);
        }

        $this->addRule($rule);
    }