Beispiel #1
0
 public function transfer(Transfer $transfer)
 {
     if ($this->number->equals($transfer->getTargetAccountNumber())) {
         throw new \InvalidArgumentException('Trying to transfer to same account');
     }
     $this->record(new MoneyTransferRequestedEvent($this->number, $transfer));
 }