diff --git a/tools/src/Docs/ProcGenerator.php b/tools/src/Docs/ProcGenerator.php index 5a2857a69..de20d9bc2 100644 --- a/tools/src/Docs/ProcGenerator.php +++ b/tools/src/Docs/ProcGenerator.php @@ -36,8 +36,17 @@ protected function getOptionsDetails(\ReflectionClass $rc): array $optiondoc['content'] = $phpdoc['content']; } + // default is set on the constructor only + $rp = null; + $cc = $rc->getMethod('__construct'); + foreach ($cc->getParameters() as $parameter) { + if ($parameter->getName() === $pname) { + $rp = $parameter; + break; + } + } $default = 'N/A'; - if ($rp = $rc->getProperty($pname)) { + if ($rp) { $dv = $rp->getDefaultValue(); $default = match (gettype($dv)) { 'boolean' => $dv ? 'true' : 'false',