protected function setUser($user)
    {
        if (!$this->isValidUsername($user)) {
            throw new \InvalidArgumentException("Invalid username '$user': double colon not allowed");
        }
        
        $this->user = (string)$user;
    }
protected function setUser($user)
    {
        if (!$this->isValidUsername($user)) {
            throw new \InvalidArgumentException("Invalid username '$user': double colon not allowed");
        }
        
        $this->user = (string)$user;
    }
protected function setUser ( $ user ) { if ( ! $ this -> isValidUsername ( $ user ) ) { throw new \ InvalidArgumentException ( "Invalid username '$user': double colon not allowed" ) ; } $ this -> user = ( string ) $ user ; }
Set the username

@param string $user
@throws \InvalidArgumentException for invalid username.
Set the username