mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 06:18:07 +01:00
afd984fc4e
b8c70125cd
[phpstan] Resolve duplicated methods (#2869)
21 lines
519 B
PHP
21 lines
519 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\PhpDocParser;
|
|
|
|
use PHPStan\Type\MixedType;
|
|
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
|
|
final class PhpDocInfoAnalyzer
|
|
{
|
|
public function isVarDocAlreadySet(PhpDocInfo $phpDocInfo) : bool
|
|
{
|
|
foreach (['@var', '@phpstan-var', '@psalm-var'] as $tagName) {
|
|
$varType = $phpDocInfo->getVarType($tagName);
|
|
if (!$varType instanceof MixedType) {
|
|
return \true;
|
|
}
|
|
}
|
|
return \false;
|
|
}
|
|
}
|