From e56a37a71814455fcefa39b2ca99bdbc09d02e70 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 8 Feb 2021 00:03:59 +1100 Subject: [PATCH] Return object not null if you have to return early!! --- app/Services/Invoice/UpdateBalance.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Services/Invoice/UpdateBalance.php b/app/Services/Invoice/UpdateBalance.php index 4ae9408c4553..cd4e50aeb641 100644 --- a/app/Services/Invoice/UpdateBalance.php +++ b/app/Services/Invoice/UpdateBalance.php @@ -16,9 +16,9 @@ use App\Services\AbstractService; class UpdateBalance extends AbstractService { - private $invoice; + public $invoice; - private $balance_adjustment; + public $balance_adjustment; public function __construct($invoice, $balance_adjustment) { @@ -29,7 +29,7 @@ class UpdateBalance extends AbstractService public function run() { if ($this->invoice->is_deleted) { - return; + return $this->invoice; } $this->invoice->balance += floatval($this->balance_adjustment);