3 namespace mdref\Generator
;
6 use phpDocumentor\Reflection\
{DocBlock
, DocBlock\Tags
};
9 class Param
extends Scrap
{
10 public function __toString() : string {
11 return parent
::toString(__FILE__
, __COMPILER_HALT_OFFSET__
, [
12 "tag" => $this->getParamTag($this->ref
->getName())
17 /** @var $gen Generator */
18 /** @var $ref \ReflectionParameter */
19 /** @var $doc ?DocBlock */
20 /** @var $tag ?Tags\Param */
24 if ($ref->isOptional()) :
27 ?
><?
= $ref->hasType() ?
$ref->getType() : str_replace("\\ref", "Reference",$tag?
->getType() ??
"mixed")
29 if ($ref->isVariadic()) : ?
>
32 if ($ref->isPassedByReference()) :
35 ?
>$
<?
= $ref->getName()
37 if ($ref->isDefaultValueAvailable()) :
38 ?
> = <?php
var_export($ref->getDefaultValue()) ?
><?php
41 if (($desc = $tag?
->getDescription() ??
$doc?
->getSummary())) :