예제 #1
0
 public function activate() : User
 {
     if ($this->status->doesntEqual(UserStatus::WAITING_FOR_APPROVAL())) {
         throw new UserIsAlreadyActivated();
     }
     $this->status = UserStatus::ACTIVE();
     return $this;
 }