public function setUser($user)
    {
        $regex = '`^' . self::$_regexUser . '$`i';

        if (preg_match_all($regex, $user, $matches) !== 1) {

            throw new InvalidArgumentException('User must match ' . $regex);
        }

        $this->_user = $user;
    }
public function setUser($user)
    {
        $regex = '`^' . self::$_regexUser . '$`i';

        if (preg_match_all($regex, $user, $matches) !== 1) {

            throw new InvalidArgumentException('User must match ' . $regex);
        }

        $this->_user = $user;
    }
public function setUser ( $ user ) { $ regex = '`^' . self :: $ _regexUser . '$`i' ; if ( preg_match_all ( $ regex , $ user , $ matches ) !== 1 ) { throw new InvalidArgumentException ( 'User must match ' . $ regex ) ; } $ this -> _user = $ user ; }
Set the user for this URL.

@param string $user The user name to send.

@throws InvalidArgumentException If the supplied username is in invalid syntax.

@return void
Set the user for this URL .