Class yii\apidoc\models\ParamDoc

Inheritanceyii\apidoc\models\ParamDoc » yii\base\BaseObject
Available since extension's version2.0
Source Code https://github.com/yiisoft/yii2-apidoc/blob/master/models/ParamDoc.php

Represents API documentation information for a function or method param.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() yii\apidoc\models\ParamDoc

Property Details

Hide inherited properties

$defaultValue public property
public string|null $defaultValue null
$description public property
public string|null $description null
$isOptional public property
public boolean|null $isOptional null
$isPassedByReference public property
$name public property
public string $name null
$parent public property
public $parent null
$sourceFile public property
public string|null $sourceFile null
$type public property
public \phpDocumentor\Reflection\Type|null $type null

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( yii\apidoc\models\FunctionDoc|yii\apidoc\models\MethodDoc $parent, \phpDocumentor\Reflection\Php\Argument|null $reflector null, yii\apidoc\models\Context|null $context null, array $config = [] )
$parent yii\apidoc\models\FunctionDoc|yii\apidoc\models\MethodDoc
$reflector \phpDocumentor\Reflection\Php\Argument|null
$context yii\apidoc\models\Context|null
$config array

                public function __construct(public $parent, $reflector = null, $context = null, $config = [])
{
    parent::__construct($config);
    if ($reflector !== null) {
        $this->name = $reflector->getName();
        if ($this->type === null) {
            $this->type = $reflector->getType();
        }
        $reflectorDefault = $reflector->getDefault();
        $this->defaultValue = $reflectorDefault !== null ? (string) $reflectorDefault : null;
        $this->isOptional = $this->defaultValue !== null;
        $this->isPassedByReference = $reflector->isByReference();
    }
    $this->name = '$' . $this->name;
}