Skip to content

Commit 2d02c91

Browse files
author
oooiik
committed
update empty logic
1 parent 014b75e commit 2d02c91

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Services/FilterService.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class FilterService
1919
*/
2020
public function __construct($client, Builder $builder)
2121
{
22-
if(is_string($client)){
22+
if (is_string($client)) {
2323
$client = new $client();
2424
}
2525
$this->client = $client;
@@ -50,18 +50,18 @@ protected function getClientMethods()
5050
protected function getClientDefault(string $key = null)
5151
{
5252
if (empty($key)) {
53-
return $this->getClient()->default ?? [];
53+
return empty($this->getClient()->default) ? [] : $this->getClient()->default;
5454
} else {
55-
return $this->getClientDefault()[$key] ?? null;
55+
return empty($this->getClientDefault()[$key]) ? null : $this->getClientDefault()[$key];
5656
}
5757
}
5858

5959
protected function getClientFallback(string $key = null)
6060
{
6161
if ($key === null) {
62-
return $this->getClient()->fallback ?? [];
62+
return empty($this->getClient()->fallback) ? [] : $this->getClient()->fallback;
6363
} else {
64-
return $this->getClientFallback()[$key] ?? null;
64+
return empty($this->getClientFallback()[$key]) ? null : $this->getClientFallback()[$key];
6565
}
6666
}
6767

@@ -80,7 +80,7 @@ protected function getParam($key = null)
8080
if ($key === null) {
8181
return $this->params;
8282
} else {
83-
return $this->params[$key] ?? null;
83+
return empty($this->params[$key]) ? null : $this->params[$key];
8484
}
8585
}
8686

0 commit comments

Comments
 (0)