1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Return object not null if you have to return early!!

This commit is contained in:
David Bomba 2021-02-08 00:03:59 +11:00
parent 6681b4fbfe
commit e56a37a718

View File

@ -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);