From 466d3de921c2654af3d3cb48dcac1829074dde3b Mon Sep 17 00:00:00 2001 From: grebenikov Date: Fri, 13 Oct 2023 17:23:14 +0300 Subject: [PATCH] Fixed bug with constant inheritance --- src/Enum.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Enum.php b/src/Enum.php index 9d09ae6..dc5a267 100644 --- a/src/Enum.php +++ b/src/Enum.php @@ -386,7 +386,7 @@ final public static function getConstants() $scopeConstants = []; // Enumerators must be defined as public class constants foreach ($reflection->getReflectionConstants() as $reflConstant) { - if ($reflConstant->isPublic()) { + if (!isset($constants[$reflConstant->getName()]) && $reflConstant->isPublic()) { $scopeConstants[ $reflConstant->getName() ] = $reflConstant->getValue(); } }