yii\apidoc\models\PropertyDoc::__construct PHP Method

__construct() public method

public __construct ( phpDocumentor\Reflection\ClassReflector\PropertyReflector $reflector = null, Context $context = null, array $config = [] )
$reflector phpDocumentor\Reflection\ClassReflector\PropertyReflector
$context Context
$config array
    public function __construct($reflector = null, $context = null, $config = [])
    {
        parent::__construct($reflector, $context, $config);
        if ($reflector === null) {
            return;
        }
        $this->visibility = $reflector->getVisibility();
        $this->isStatic = $reflector->isStatic();
        // bypass $reflector->getDefault() for short array syntax
        if ($reflector->getNode()->default) {
            $this->defaultValue = PrettyPrinter::getRepresentationOfValue($reflector->getNode()->default);
        }
        $hasInheritdoc = false;
        foreach ($this->tags as $tag) {
            if ($tag->getName() === 'inheritdoc') {
                $hasInheritdoc = true;
            }
            if ($tag instanceof VarTag) {
                $this->type = $tag->getType();
                $this->types = $tag->getTypes();
                $this->description = static::mbUcFirst($tag->getDescription());
                $this->shortDescription = BaseDoc::extractFirstSentence($this->description);
            }
        }
        if (empty($this->shortDescription) && $context !== null && !$hasInheritdoc) {
            $context->warnings[] = ['line' => $this->startLine, 'file' => $this->sourceFile, 'message' => "No short description for element '{$this->name}'"];
        }
    }