From: Michael Wallner Date: Thu, 20 Jan 2022 08:48:19 +0000 (+0100) Subject: Generator: fix default values of ctor promoted props X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=5049ac5407240b679b54f26dcdcb6dca4e478217;p=mdref%2Fmdref Generator: fix default values of ctor promoted props --- diff --git a/mdref/Generator/Prop.php b/mdref/Generator/Prop.php index 69d07ce..22f20bf 100644 --- a/mdref/Generator/Prop.php +++ b/mdref/Generator/Prop.php @@ -15,7 +15,7 @@ class Prop extends Scrap { } /** @var $gen Generator */ -/** @var $ref \ReflectionParameter */ +/** @var $ref \ReflectionProperty */ /** @var $doc ?DocBlock */ /** @var $tag ?Tags\Param */ @@ -25,6 +25,15 @@ __HALT_COMPILER(); ?> $getName() ?>hasDefaultValue()) : ?> = getDefaultValue()) ?>getDeclaringClass()->getConstructor()?->getParameters())) : + foreach ($params as $param) : + if ($param->getName() === $ref->name) : + if ($param->isDefaultValueAvailable()) : + ?> = getDefaultValue()) ?>getSummary())) :