Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[phpstan] Fix var assumed ignored errors #6571

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ parameters:
-
identifier: argument.type

-
identifier: phpstanApi.varTagAssumption
# -
# identifier: phpstanApi.varTagAssumption

# is nested expr
-
Expand Down
1 change: 0 additions & 1 deletion rules/TypeDeclaration/TypeInferer/ReturnTypeInferer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use PHPStan\Type\MixedType;
use PHPStan\Type\Type;
use Rector\TypeDeclaration\TypeInferer\ReturnTypeInferer\ReturnedNodesReturnTypeInfererTypeInferer;
use Rector\TypeDeclaration\TypeNormalizer;

/**
* @internal
Expand Down
1 change: 0 additions & 1 deletion src/Autoloading/BootstrapFilesIncluder.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function includeBootstrapFiles(): void

private function requireRectorStubs(): void
{
/** @var false|string $stubsRectorDirectory */
$stubsRectorDirectory = realpath(__DIR__ . '/../../stubs-rector');
if ($stubsRectorDirectory === false) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/BetterPhpDocParser/PhpDocInfo/PhpDocInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ public function findByAnnotationClass(string $desiredClass): array
private function resolveNameForPhpDocTagValueNode(PhpDocTagValueNode $phpDocTagValueNode): ?string
{
foreach (self::TAGS_TYPES_TO_NAMES as $tagValueNodeType => $name) {
/** @var class-string<PhpDocTagNode> $tagValueNodeType */
/** @var class-string<PhpDocTagValueNode> $tagValueNodeType */
if ($phpDocTagValueNode instanceof $tagValueNodeType) {
return $name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ public function enterNode(Node $node): ?Node
$objectType = $this->ensureFQCNObject($staticType, $node->name);

foreach ($this->oldToNewTypes as $oldToNewType) {
/** @var ObjectType $oldType */
$oldType = $oldToNewType->getOldType();
if (! $oldType instanceof ObjectType) {
continue;
}

if (! $objectType->equals($oldType)) {
continue;
}
Expand Down
Loading