From 8c5cfafd4429765fecd1f3db9546cdb9abef080f Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 5 Sep 2023 13:41:45 +0200 Subject: [PATCH] FamilyRelationsAnalyzer: final classes can't have children (#4913) --- packages/FamilyTree/Reflection/FamilyRelationsAnalyzer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/FamilyTree/Reflection/FamilyRelationsAnalyzer.php b/packages/FamilyTree/Reflection/FamilyRelationsAnalyzer.php index 30decec80c4..1732d805bfd 100644 --- a/packages/FamilyTree/Reflection/FamilyRelationsAnalyzer.php +++ b/packages/FamilyTree/Reflection/FamilyRelationsAnalyzer.php @@ -28,6 +28,10 @@ public function __construct( */ public function getChildrenOfClassReflection(ClassReflection $desiredClassReflection): array { + if ($desiredClassReflection->isFinalByKeyword()) { + return []; + } + /** @var ClassReflection[] $classReflections */ $classReflections = $this->privatesAccessor->getPrivateProperty($this->reflectionProvider, 'classes');