Skip to content

Commit ae223d7

Browse files
authored
Merge pull request #2902 from yajra/patch-stan
fix(phpstan): Cannot cast object to string.
2 parents 258d4a2 + 047dcd8 commit ae223d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Utilities/Helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ protected static function transformRow($row)
206206
if ($value instanceof DateTime) {
207207
$row[$key] = $value->format('Y-m-d H:i:s');
208208
} else {
209-
if (is_object($value)) {
210-
$row[$key] = (string) $value;
209+
if (is_object($value) && method_exists($value, '__toString')) {
210+
$row[$key] = $value->__toString();
211211
} else {
212212
$row[$key] = $value;
213213
}

0 commit comments

Comments
 (0)