Phan\Language\Element\Parameter::__toString PHP Method

__toString() public method

public __toString ( ) : string
return string
    public function __toString() : string
    {
        $string = '';
        $typeObj = $this->getVariadicElementUnionType();
        if (!$typeObj->isEmpty()) {
            $string .= (string) $typeObj . ' ';
        }
        if ($this->isPassByReference()) {
            $string .= '&';
        }
        $string .= "\${$this->getName()}";
        if ($this->isVariadic()) {
            $string .= ' ...';
        }
        if ($this->hasDefaultValue()) {
            if ($this->getDefaultValue() instanceof \ast\Node) {
                $string .= ' = null';
            } else {
                $string .= ' = ' . (string) $this->getDefaultValue();
            }
        }
        return $string;
    }