Commit Graph

1 Commits

Author SHA1 Message Date
Marijn van Wezel ba5c2c83da Improve export of enums
This commit improves the export of enumerations (see https://wiki.php.net/rfc/enumerations). This change is backwards-compatible with PHP 8.0. Previously, enums would be exported as objects (which they are internally), for instance:

```
SebastianBergmann\Exporter\ExampleEnum Object #%d (
    'name' => 'Value'
)"
```

This commit changes that behaviour and improves the export for both backed and non-backed enums:

Unit enum:
 SebastianBergmann\Exporter\ExampleEnum Enum #%d (Value)

Backed enum:
 SebastianBergmann\Exporter\ExampleBackedEnum Enum #%d (Value, 'value')
2022-01-22 07:30:17 +01:00