Skip to content

Commit

Permalink
Enums do not allow dynamic properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 12, 2023
1 parent 446ead7 commit 0aa7f41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Reflection/ClassReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ private function collectTraits(ReflectionClass|ReflectionEnum $class): array

public function allowsDynamicProperties(): bool

This comment has been minimized.

Copy link
@staabm

staabm Jan 12, 2023

Contributor

this change makes me think whether we should treat php-src internal classes/object (so non-userland classes) as those not allowing dynamic properties?

{
if ($this->isEnum()) {
return false;
}

if (!$this->phpVersion->deprecatesDynamicProperties()) {
return true;
}
Expand Down

0 comments on commit 0aa7f41

Please sign in to comment.