Skip to content

Commit

Permalink
resolve from file
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jun 26, 2024
1 parent 751207b commit 6dce1ce
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions rules/TypeDeclaration/PHPStan/ObjectTypeSpecifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Rector\TypeDeclaration\PHPStan;

use Nette\Utils\Strings;
use PhpParser\Node;
use PhpParser\Node\Identifier;
use PhpParser\Node\Stmt\GroupUse;
use PhpParser\Node\Stmt\Use_;
Expand Down Expand Up @@ -44,7 +43,6 @@ public function __construct(
}

public function narrowToFullyQualifiedOrAliasedObjectType(
Node $node,
ObjectType $objectType,
Scope|null $scope
): TypeWithClassName | NonExistingObjectType | UnionType | MixedType {
Expand Down
2 changes: 1 addition & 1 deletion src/NodeTypeResolver/NodeTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function getType(Node $node): Type

if ($type instanceof ObjectType) {
$scope = $node->getAttribute(AttributeKey::SCOPE);
$type = $this->objectTypeSpecifier->narrowToFullyQualifiedOrAliasedObjectType($node, $type, $scope);
$type = $this->objectTypeSpecifier->narrowToFullyQualifiedOrAliasedObjectType($type, $scope);
}

return $type;
Expand Down
2 changes: 1 addition & 1 deletion src/StaticTypeMapper/PhpDocParser/IdentifierTypeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function mapIdentifierTypeNode(IdentifierTypeNode $identifierTypeNode, No
}

$scope = $node->getAttribute(AttributeKey::SCOPE);
return $this->objectTypeSpecifier->narrowToFullyQualifiedOrAliasedObjectType($node, $objectType, $scope);
return $this->objectTypeSpecifier->narrowToFullyQualifiedOrAliasedObjectType($objectType, $scope);
}

private function mapSelf(Node $node): MixedType | SelfObjectType
Expand Down

0 comments on commit 6dce1ce

Please sign in to comment.