Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[VarExporter] Fix exporting enums
  • Loading branch information
nicolas-grekas committed Jan 12, 2023
commit 4574d8760851b6a34558cb4703c3739f919ac51f
2 changes: 1 addition & 1 deletion src/Symfony/Component/VarExporter/Internal/Exporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public static function export($value, string $indent = '')
case true === $value: return 'true';
case null === $value: return 'null';
case '' === $value: return "''";
case $value instanceof \UnitEnum: return ltrim(var_export($value, true), '\\');
case $value instanceof \UnitEnum: return '\\'.ltrim(var_export($value, true), '\\');
}

if ($value instanceof Reference) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

return [
Symfony\Component\VarExporter\Tests\Fixtures\FooUnitEnum::Bar,
\Symfony\Component\VarExporter\Tests\Fixtures\FooUnitEnum::Bar,
];