From d16328d6115fad6055e012bd5b46968d7f1b3d56 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 9 Aug 2023 07:44:34 +1000 Subject: [PATCH] Fixes for static analysis --- app/PaymentDrivers/BaseDriver.php | 6 +++++- app/PaymentDrivers/StripePaymentDriver.php | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index fcfd766837..43290710a7 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -56,7 +56,11 @@ class BaseDriver extends AbstractPaymentDriver /* The Invitation */ public $invitation; - /* The client */ + /** + * The Client + * + * @var \App\Models\Client|null $client + */ public $client; /* Gateway capabilities */ diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index 951d9eea9b..a80c09789d 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -891,9 +891,11 @@ class StripePaymentDriver extends BaseDriver return Account::all(); } - public function setClientFromCustomer($customer) + public function setClientFromCustomer($customer): self { - $this->client = ClientGatewayToken::query()->where('gateway_customer_reference', $customer)->client; + $this->client = ClientGatewayToken::query()->where('gateway_customer_reference', $customer)->first()->client; + + return $this; } /**