Skip to content

Commit 2aec2ba

Browse files
committed
Combine two ifs
1 parent 717ca54 commit 2aec2ba

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Engine/Encoder.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,9 @@ private function encodeObject($value): string
7373
}
7474

7575
// all other traversables are dictionaries
76-
if ($value instanceof \Traversable) {
77-
return $this->encodeDictionary($value);
78-
}
79-
8076
// also treat stdClass as a dictionary
81-
if ($value instanceof \stdClass) {
82-
return $this->encodeDictionary((array)$value);
77+
if ($value instanceof \Traversable || $value instanceof \stdClass) {
78+
return $this->encodeDictionary($value);
8379
}
8480

8581
// try to convert other objects to string

0 commit comments

Comments
 (0)