Skip to content

Commit 7e6353d

Browse files
[phpstan] Fix var assumed ignored errors (#6571)
* [phpstan] Fix var assumed ignored errors * [ci-review] Rector Rectify --------- Co-authored-by: GitHub Action <[email protected]>
1 parent 6fce22d commit 7e6353d

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

phpstan.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ parameters:
8383
-
8484
identifier: argument.type
8585

86-
-
87-
identifier: phpstanApi.varTagAssumption
86+
# -
87+
# identifier: phpstanApi.varTagAssumption
8888

8989
# is nested expr
9090
-

rules/TypeDeclaration/TypeInferer/ReturnTypeInferer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use PHPStan\Type\MixedType;
1111
use PHPStan\Type\Type;
1212
use Rector\TypeDeclaration\TypeInferer\ReturnTypeInferer\ReturnedNodesReturnTypeInfererTypeInferer;
13-
use Rector\TypeDeclaration\TypeNormalizer;
1413

1514
/**
1615
* @internal

src/Autoloading/BootstrapFilesIncluder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public function includeBootstrapFiles(): void
4141

4242
private function requireRectorStubs(): void
4343
{
44-
/** @var false|string $stubsRectorDirectory */
4544
$stubsRectorDirectory = realpath(__DIR__ . '/../../stubs-rector');
4645
if ($stubsRectorDirectory === false) {
4746
return;

src/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ public function findByAnnotationClass(string $desiredClass): array
529529
private function resolveNameForPhpDocTagValueNode(PhpDocTagValueNode $phpDocTagValueNode): ?string
530530
{
531531
foreach (self::TAGS_TYPES_TO_NAMES as $tagValueNodeType => $name) {
532-
/** @var class-string<PhpDocTagNode> $tagValueNodeType */
532+
/** @var class-string<PhpDocTagValueNode> $tagValueNodeType */
533533
if ($phpDocTagValueNode instanceof $tagValueNodeType) {
534534
return $name;
535535
}

src/NodeTypeResolver/PhpDocNodeVisitor/ClassRenamePhpDocNodeVisitor.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ public function enterNode(Node $node): ?Node
7373
$objectType = $this->ensureFQCNObject($staticType, $node->name);
7474

7575
foreach ($this->oldToNewTypes as $oldToNewType) {
76-
/** @var ObjectType $oldType */
7776
$oldType = $oldToNewType->getOldType();
77+
if (! $oldType instanceof ObjectType) {
78+
continue;
79+
}
80+
7881
if (! $objectType->equals($oldType)) {
7982
continue;
8083
}

0 commit comments

Comments
 (0)