PHPStan\Reflection\Php\PhpParameterReflection::getType PHP Method

getType() public method

public getType ( ) : PHPStan\Type\Type
return PHPStan\Type\Type
    public function getType() : Type
    {
        if ($this->type === null) {
            $phpDocType = $this->phpDocType;
            if ($phpDocType !== null && $this->reflection->isDefaultValueAvailable() && $this->reflection->getDefaultValue() === null) {
                $phpDocType = $phpDocType->makeNullable();
            }
            $this->type = TypehintHelper::decideType($this->reflection->getType(), $phpDocType, $this->reflection->getDeclaringClass() !== null ? $this->reflection->getDeclaringClass()->getName() : null, $this->reflection->isVariadic());
        }
        return $this->type;
    }