From 5e19c124d4c730c66da492636256da3bb3a978bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20B=C5=99e=C4=8Dka?= Date: Mon, 6 Sep 2021 07:22:34 +0200 Subject: [PATCH] Fix returning bool in Customer::findByExternalId() (#91) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vojtěch Dobeš --- src/Customer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Customer.php b/src/Customer.php index 7e64a81..bcbe93d 100644 --- a/src/Customer.php +++ b/src/Customer.php @@ -113,7 +113,10 @@ public static function findByExternalId($externalId, ClientInterface $client = n $response = self::all($externalId, $client); - if ($response instanceof Collection) { + if ( + $response instanceof Collection + && !$response->isEmpty() + ) { return $response->first(); }