Class yii\apidoc\models\ParamDoc

Inheritanceyii\apidoc\models\ParamDoc » yii\base\Object
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 $defaultValue null
$description public property
public $description null
$isOptional public property
public $isOptional null
$isPassedByReference public property
public $isPassedByReference null
$name public property
public $name null
$sourceFile public property
public $sourceFile null
$type public property
public $type null
$typeHint public property
public $typeHint null
$types public property
public $types null

Method Details

Hide inherited methods

__construct() public method

public void __construct ( $reflector null, $context null, $config = [] )
$reflector \phpDocumentor\Reflection\FunctionReflector\ArgumentReflector
$context yii\apidoc\models\Context
$config array

                public function __construct($reflector = null, $context = null, $config = [])
{
    parent::__construct($config);
    if ($reflector === null) {
        return;
    }
    $this->name = $reflector->getName();
    $this->typeHint = $reflector->getType();
    $this->isOptional = $reflector->getDefault() !== null;
    // bypass $reflector->getDefault() for short array syntax
    if ($reflector->getNode()->default) {
        $this->defaultValue = PrettyPrinter::getRepresentationOfValue($reflector->getNode()->default);
    }
    $this->isPassedByReference = $reflector->isByRef();
}