Class yii\apidoc\models\ParamDoc
Inheritance | yii\apidoc\models\ParamDoc » yii\base\BaseObject |
---|---|
Available since extension's version | 2.0 |
Source Code | https://github.com/yiisoft/yii2-apidoc/blob/master/models/ParamDoc.php |
Public Properties
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | yii\apidoc\models\ParamDoc |
Property Details
Method Details
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();
}