From 2d02c91811dc37f2c3526c6520a63a12802378f2 Mon Sep 17 00:00:00 2001 From: oooiik Date: Wed, 9 Nov 2022 10:16:24 +0500 Subject: [PATCH] update empty logic --- src/Services/FilterService.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Services/FilterService.php b/src/Services/FilterService.php index c36fc2b..c75d01f 100644 --- a/src/Services/FilterService.php +++ b/src/Services/FilterService.php @@ -19,7 +19,7 @@ class FilterService */ public function __construct($client, Builder $builder) { - if(is_string($client)){ + if (is_string($client)) { $client = new $client(); } $this->client = $client; @@ -50,18 +50,18 @@ protected function getClientMethods() protected function getClientDefault(string $key = null) { if (empty($key)) { - return $this->getClient()->default ?? []; + return empty($this->getClient()->default) ? [] : $this->getClient()->default; } else { - return $this->getClientDefault()[$key] ?? null; + return empty($this->getClientDefault()[$key]) ? null : $this->getClientDefault()[$key]; } } protected function getClientFallback(string $key = null) { if ($key === null) { - return $this->getClient()->fallback ?? []; + return empty($this->getClient()->fallback) ? [] : $this->getClient()->fallback; } else { - return $this->getClientFallback()[$key] ?? null; + return empty($this->getClientFallback()[$key]) ? null : $this->getClientFallback()[$key]; } } @@ -80,7 +80,7 @@ protected function getParam($key = null) if ($key === null) { return $this->params; } else { - return $this->params[$key] ?? null; + return empty($this->params[$key]) ? null : $this->params[$key]; } }