diff --git a/Internal/Exporter.php b/Internal/Exporter.php index f4e5746..6ee3ee7 100644 --- a/Internal/Exporter.php +++ b/Internal/Exporter.php @@ -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) { diff --git a/Tests/Fixtures/unit-enum.php b/Tests/Fixtures/unit-enum.php index 48ab51d..98bc122 100644 --- a/Tests/Fixtures/unit-enum.php +++ b/Tests/Fixtures/unit-enum.php @@ -1,5 +1,5 @@