Skip to content

Commit

Permalink
Updated Rector to commit 88648d1e6fe18bcc67ea76ebdc76c1d1e6d1fe6f
Browse files Browse the repository at this point in the history
rectorphp/rector-src@88648d1 [DeadCode] Skip @param true on native bool type on RemoveUselessParamTagRector (#5798)
  • Loading branch information
TomasVotruba committed Apr 3, 2024
1 parent 81fd362 commit 6e65fef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions rules/DeadCode/PhpDoc/DeadParamTagValueNodeAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
use Rector\BetterPhpDocParser\ValueObject\Type\BracketsAwareUnionTypeNode;
use Rector\DeadCode\PhpDoc\Guard\StandaloneTypeRemovalGuard;
use Rector\DeadCode\TypeNodeAnalyzer\GenericTypeNodeAnalyzer;
use Rector\DeadCode\TypeNodeAnalyzer\MixedArrayTypeNodeAnalyzer;
use Rector\NodeNameResolver\NodeNameResolver;
Expand Down Expand Up @@ -47,14 +48,20 @@ final class DeadParamTagValueNodeAnalyzer
* @var \Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger
*/
private $phpDocTypeChanger;
public function __construct(NodeNameResolver $nodeNameResolver, TypeComparator $typeComparator, GenericTypeNodeAnalyzer $genericTypeNodeAnalyzer, MixedArrayTypeNodeAnalyzer $mixedArrayTypeNodeAnalyzer, ParamAnalyzer $paramAnalyzer, PhpDocTypeChanger $phpDocTypeChanger)
/**
* @readonly
* @var \Rector\DeadCode\PhpDoc\Guard\StandaloneTypeRemovalGuard
*/
private $standaloneTypeRemovalGuard;
public function __construct(NodeNameResolver $nodeNameResolver, TypeComparator $typeComparator, GenericTypeNodeAnalyzer $genericTypeNodeAnalyzer, MixedArrayTypeNodeAnalyzer $mixedArrayTypeNodeAnalyzer, ParamAnalyzer $paramAnalyzer, PhpDocTypeChanger $phpDocTypeChanger, StandaloneTypeRemovalGuard $standaloneTypeRemovalGuard)
{
$this->nodeNameResolver = $nodeNameResolver;
$this->typeComparator = $typeComparator;
$this->genericTypeNodeAnalyzer = $genericTypeNodeAnalyzer;
$this->mixedArrayTypeNodeAnalyzer = $mixedArrayTypeNodeAnalyzer;
$this->paramAnalyzer = $paramAnalyzer;
$this->phpDocTypeChanger = $phpDocTypeChanger;
$this->standaloneTypeRemovalGuard = $standaloneTypeRemovalGuard;
}
public function isDead(ParamTagValueNode $paramTagValueNode, FunctionLike $functionLike) : bool
{
Expand All @@ -78,7 +85,7 @@ public function isDead(ParamTagValueNode $paramTagValueNode, FunctionLike $funct
return \false;
}
if (!$paramTagValueNode->type instanceof BracketsAwareUnionTypeNode) {
return \true;
return $this->standaloneTypeRemovalGuard->isLegal($paramTagValueNode->type, $param->type);
}
return $this->isAllowedBracketAwareUnion($paramTagValueNode->type);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '91ed251a8c450a776ec4b739c735b4bd6f9bf8d5';
public const PACKAGE_VERSION = '88648d1e6fe18bcc67ea76ebdc76c1d1e6d1fe6f';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-04-03 19:11:18';
public const RELEASE_DATE = '2024-04-03 13:36:35';
/**
* @var int
*/
Expand Down

0 comments on commit 6e65fef

Please sign in to comment.