Skip to content

Commit

Permalink
fix deprecations (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba authored Sep 2, 2024
1 parent ef84d74 commit fb26209
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"doctrine/orm": "^2.19",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan-deprecation-rules": "^1.2",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpunit/phpunit": "^10.5",
"rector/rector-src": "dev-main",
Expand Down
4 changes: 4 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ parameters:
-
message: '#PHPDoc tag @return contains unresolvable type#'
path: rules/CodeQuality/Contract/PropertyAttributeTransformerInterface.php

# needed for instanceof method API
- '#Doing instanceof PHPStan\\Type\\ObjectType is error\-prone and deprecated\. Use Type\:\:isObject\(\) or Type\:\:getObjectClassNames\(\) instead#'
- '#Doing instanceof PHPStan\\Type\\(Generic\\GenericObjectType|ArrayType) is error\-prone and deprecated#'
2 changes: 1 addition & 1 deletion src/TypeAnalyzer/CollectionTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function resolveFromTypeNode(TypeNode $typeNode, Node $node): ?FullyQuali
}

if ($typeNode instanceof ArrayTypeNode && $typeNode->type instanceof IdentifierTypeNode) {
$nameScope = $this->nameScopeFactory->createNameScopeFromNode($node);
$nameScope = $this->nameScopeFactory->createNameScopeFromNodeWithoutTemplateTypes($node);
$fullyQualifiedName = $nameScope->resolveStringName($typeNode->type->name);
return new FullyQualifiedObjectType($fullyQualifiedName);
}
Expand Down

0 comments on commit fb26209

Please sign in to comment.