Skip to content

Commit b074037

Browse files
committed
Simplify if statements
1 parent 05ab401 commit b074037

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Query/Query.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,8 @@ protected function boot() {
120120
* @return string
121121
*/
122122
protected function parse_value($value): string {
123-
switch (true) {
124-
case $value instanceof Carbon:
125-
$value = $value->format($this->date_format);
126-
break;
123+
if ($value instanceof Carbon) {
124+
$value = $value->format($this->date_format);
127125
}
128126

129127
return (string)$value;
@@ -189,7 +187,7 @@ protected function search(): Collection {
189187

190188
try {
191189
$available_messages = $this->client->getConnection()->search([$this->getRawQuery()], $this->sequence);
192-
return $available_messages !== false ? new Collection($available_messages) : new Collection();
190+
return new Collection($available_messages);
193191
} catch (RuntimeException $e) {
194192
throw new GetMessagesFailedException("failed to fetch messages", 0, $e);
195193
} catch (ConnectionFailedException $e) {

0 commit comments

Comments
 (0)