-
-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Rector to commit afe7c46c0387e27e1eae37cf76f8a3a4119a1d39
rectorphp/rector-src@afe7c46 [DeadCode] Skip nullable @ template on RemoveUselessReturnTagRector (#6409)
- Loading branch information
1 parent
3b34bec
commit b5c99e3
Showing
7 changed files
with
57 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare (strict_types=1); | ||
namespace Rector\DeadCode\PhpDoc\Guard; | ||
|
||
use PHPStan\Type\Type; | ||
use PHPStan\Type\UnionType; | ||
use PHPStan\Type\Generic\TemplateType; | ||
final class TemplateTypeRemovalGuard | ||
{ | ||
public function isLegal(Type $docType) : bool | ||
{ | ||
// cover direct \PHPStan\Type\Generic\TemplateUnionType | ||
if ($docType instanceof TemplateType) { | ||
return \false; | ||
} | ||
// cover mixed template with mix from @template and non @template | ||
$types = $docType instanceof UnionType ? $docType->getTypes() : [$docType]; | ||
foreach ($types as $type) { | ||
if ($type instanceof TemplateType) { | ||
return \false; | ||
} | ||
} | ||
return \true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters