public static decideType ( ReflectionType $reflectionType = null, PHPStan\Type\Type $phpDocType = null, string $selfClass = null, boolean $isVariadic = false ) : PHPStan\Type\Type | ||
$reflectionType | ReflectionType | |
$phpDocType | PHPStan\Type\Type | |
$selfClass | string | |
$isVariadic | boolean | |
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; }
public function getReturnType() : Type { if ($this->returnType === null) { $phpDocReturnType = $this->phpDocReturnType; if ($this->realReturnTypePresent && $phpDocReturnType !== null && $this->realReturnType->isNullable() !== $phpDocReturnType->isNullable()) { $phpDocReturnType = null; } $this->returnType = TypehintHelper::decideType($this->realReturnType, $phpDocReturnType); } return $this->returnType; }
public function getReturnType() : Type { if ($this->returnType === null) { $this->returnType = TypehintHelper::decideType($this->reflection->getReturnType(), $this->phpDocReturnType, $this->declaringClass->getName()); } return $this->returnType; }