Skip to content

Commit 0aa7f41

Browse files
committed
Enums do not allow dynamic properties
1 parent 446ead7 commit 0aa7f41

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Reflection/ClassReflection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ private function collectTraits(ReflectionClass|ReflectionEnum $class): array
346346

347347
public function allowsDynamicProperties(): bool
348348
{
349+
if ($this->isEnum()) {
350+
return false;
351+
}
352+
349353
if (!$this->phpVersion->deprecatesDynamicProperties()) {
350354
return true;
351355
}

0 commit comments

Comments
 (0)