Skip to content

Commit bc5f57a

Browse files
Fix dumping enums on PHP 8.2
1 parent ed78ec3 commit bc5f57a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Internal/Exporter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,13 @@ public static function prepare($values, $objectsPool, &$refsPool, &$objectsCount
195195
public static function export($value, $indent = '')
196196
{
197197
switch (true) {
198-
case \is_int($value) || \is_float($value) || $value instanceof \UnitEnum: return var_export($value, true);
198+
case \is_int($value) || \is_float($value): return var_export($value, true);
199199
case [] === $value: return '[]';
200200
case false === $value: return 'false';
201201
case true === $value: return 'true';
202202
case null === $value: return 'null';
203203
case '' === $value: return "''";
204+
case $value instanceof \UnitEnum: return ltrim(var_export($value, true), '\\');
204205
}
205206

206207
if ($value instanceof Reference) {

0 commit comments

Comments
 (0)