src/User/User.php
public function rename($username)
    {
        if ($username !== $this->username) {
            $oldUsername = $this->username;
            $this->username = $username;

            $this->raise(new Renamed($this, $oldUsername));
        }

        return $this;
    }
public function rename($username)
    {
        if ($username !== $this->username) {
            $oldUsername = $this->username;
            $this->username = $username;

            $this->raise(new Renamed($this, $oldUsername));
        }

        return $this;
    }
public function rename ( $ username ) { if ( $ username !== $ this -> username ) { $ oldUsername = $ this -> username ; $ this -> username = $ username ; $ this -> raise ( new Renamed ( $ this , $ oldUsername ) ) ; } return $ this ; }
Rename the user.

@param string $username
@return $this
Rename the user .