From af722d5f6764dbd1a2230b63e332cb2d837a5036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Murat=20SA=C3=87?= Date: Mon, 4 Nov 2019 13:33:16 +0300 Subject: [PATCH] Return annotation fix & return type (#57) --- src/Customer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Customer.php b/src/Customer.php index 20c6fb4..062bb5b 100644 --- a/src/Customer.php +++ b/src/Customer.php @@ -99,9 +99,9 @@ public function customAttributes() /** * Find a Customer by External ID. Returns only first result! * @param string $externalId - * @return Customer + * @return Customer|null */ - public static function findByExternalId($externalId) + public static function findByExternalId($externalId): ?Customer { if (gettype($externalId) == 'string') { $externalId = ['external_id' => $externalId]; @@ -111,9 +111,9 @@ public static function findByExternalId($externalId) if (is_null($response)) { return null; - } else { - return $response->first(); } + + return $response->first(); } /**