Skip to content

Commit 1c4268f

Browse files
committed
fix phpstan self-analysis errors: ignore property.notFound, add null guard in getTypeAliasName
1 parent 477070a commit 1c4268f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/PhpDoc/PhpDocNodeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ public function resolveTypeAliasTags(PhpDocNode $phpDocNode, NameScope $nameScop
522522
foreach ($phpDocNode->getTypeAliasTagValues($tagName) as $typeAliasTagValue) {
523523
$alias = $typeAliasTagValue->alias;
524524
$typeNode = $typeAliasTagValue->type;
525-
$resolved[$alias] = new TypeAliasTag($alias, $typeNode, $nameScope, $typeAliasTagValue->templateTypes ?? []);
525+
$resolved[$alias] = new TypeAliasTag($alias, $typeNode, $nameScope, $typeAliasTagValue->templateTypes ?? []); // @phpstan-ignore property.notFound
526526
}
527527
}
528528

src/Type/Generic/TemplateTypeScope.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function isTypeAlias(): bool
6060
/** @api */
6161
public function getTypeAliasName(): ?string
6262
{
63-
if (!$this->isTypeAlias()) {
63+
if (!$this->isTypeAlias() || $this->functionName === null) {
6464
return null;
6565
}
6666

0 commit comments

Comments
 (0)