diff --git a/src/PhpSpreadsheet/Cell/StringValueBinder.php b/src/PhpSpreadsheet/Cell/StringValueBinder.php index e253e7be..6c25bda0 100644 --- a/src/PhpSpreadsheet/Cell/StringValueBinder.php +++ b/src/PhpSpreadsheet/Cell/StringValueBinder.php @@ -86,7 +86,7 @@ class StringValueBinder implements IValueBinder if ($value instanceof DateTimeInterface) { $value = $value->format('Y-m-d H:i:s'); } elseif ($value instanceof RichText) { - $cell->setValueExplicit((string)$value, DataType::TYPE_INLINE); + $cell->setValueExplicit($value, DataType::TYPE_INLINE); return true; } diff --git a/tests/PhpSpreadsheetTests/Cell/StringValueBinderTest.php b/tests/PhpSpreadsheetTests/Cell/StringValueBinderTest.php index 1a8533aa..411af353 100644 --- a/tests/PhpSpreadsheetTests/Cell/StringValueBinderTest.php +++ b/tests/PhpSpreadsheetTests/Cell/StringValueBinderTest.php @@ -6,7 +6,6 @@ use DateTime; use DateTimeZone; use PhpOffice\PhpSpreadsheet\Cell\Cell; use PhpOffice\PhpSpreadsheet\Cell\DataType; -use PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder; use PhpOffice\PhpSpreadsheet\Cell\StringValueBinder; use PhpOffice\PhpSpreadsheet\RichText\RichText; use PhpOffice\PhpSpreadsheet\Style\Style;