Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jdreesen authored Mar 27, 2024
1 parent 03783ba commit 310ddfe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Prophecy/Doubler/Generator/ClassCodeGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ private function generateArguments(array $arguments): array
if ($argument->isOptional() && !$argument->isVariadic()) {
$default = var_export($argument->getDefault(), true);

// This is necessary for PHP 8.1, as enum cases are exported without a leading slash in this version
if ($argument->getDefault() instanceof \UnitEnum && 0 !== strpos($default, '\\')) {
$default = '\\'.$default;
}
Expand Down

0 comments on commit 310ddfe

Please sign in to comment.