client = $payment->client; $this->payment = $payment; } public function run() { if ($this->payment->number != '') { return $this->payment; } $this->payment->number = $this->getNextPaymentNumber($this->client); return $this->payment; } }