public function alias(string $name, $rules, ?string $error = null): self
    {
        $this->definitions[$name] = function () use ($rules, $error) {
            return $this->parser->parse($rules)->setError($error);
        };
        return $this;
    }
public function alias(string $name, $rules, ?string $error = null): self
    {
        $this->definitions[$name] = function () use ($rules, $error) {
            return $this->parser->parse($rules)->setError($error);
        };
        return $this;
    }
public function alias ( string $ name , $ rules , ? string $ error = null ) : self { $ this -> definitions [ $ name ] = function ( ) use ( $ rules , $ error ) { return $ this -> parser -> parse ( $ rules ) -> setError ( $ error ) ; } ; return $ this ; }
Registers an alias for a ruleset.

@param string $name The name of the alias
@param object|array $rules The ruleset to alias
@param string|null $error A custom error code to return, or `null` to use normal codes
@return $this provides a fluent interface
Registers an alias for a ruleset .