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