mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 11:44:14 +01:00
check for missing doc
This commit is contained in:
parent
9796048c8c
commit
15ac2c6647
@ -8,6 +8,7 @@ use PhpParser\Node\Expr\Closure;
|
||||
use PhpParser\Node\FunctionLike;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Function_;
|
||||
use PHPStan\Type\MixedType;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
@ -21,8 +22,11 @@ final class ReturnTagReturnTypeInferer extends AbstractTypeInferer implements Re
|
||||
*/
|
||||
public function inferFunctionLike(FunctionLike $functionLike): Type
|
||||
{
|
||||
/** @var PhpDocInfo $phpDocInfo */
|
||||
/** @var PhpDocInfo|null $phpDocInfo */
|
||||
$phpDocInfo = $functionLike->getAttribute(AttributeKey::PHP_DOC_INFO);
|
||||
if ($phpDocInfo === null) {
|
||||
return new MixedType();
|
||||
}
|
||||
|
||||
return $phpDocInfo->getReturnType();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user