From 281746e07e97e5a77a7842002d3833c59c73b65d Mon Sep 17 00:00:00 2001 From: Ion Bazan Date: Mon, 21 Nov 2022 09:22:47 +0800 Subject: [PATCH] Fix generating final classes from reflection Signed-off-by: Ion Bazan --- src/Generator/ClassGenerator.php | 1 + test/Generator/ClassGeneratorTest.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Generator/ClassGenerator.php b/src/Generator/ClassGenerator.php index c596d4ec..add1a644 100644 --- a/src/Generator/ClassGenerator.php +++ b/src/Generator/ClassGenerator.php @@ -85,6 +85,7 @@ public static function fromReflection(ClassReflection $classReflection) } $cg->setAbstract($classReflection->isAbstract()); + $cg->setFinal($classReflection->isFinal()); // set the namespace if ($classReflection->inNamespace()) { diff --git a/test/Generator/ClassGeneratorTest.php b/test/Generator/ClassGeneratorTest.php index 689ad6a7..addd4ec1 100644 --- a/test/Generator/ClassGeneratorTest.php +++ b/test/Generator/ClassGeneratorTest.php @@ -1395,7 +1395,7 @@ public function testClassWithPromotedParameterFromReflection(): void $expectedOutput = <<