Skip to content

Commit 60cdcc3

Browse files
committed
Temporary Rector fix
1 parent 4b74eee commit 60cdcc3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

phpstan-baseline.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ parameters:
143143
count: 1
144144
path: src/PhpDoc/PhpDocBlock.php
145145

146+
-
147+
message: "#^Call to function method_exists\\(\\) with PHPStan\\\\PhpDocParser\\\\Ast\\\\PhpDoc\\\\PhpDocNode and 'getSelfOutTypeTagVa…' will always evaluate to true\\.$#"
148+
count: 1
149+
path: src/PhpDoc/PhpDocNodeResolver.php
150+
146151
-
147152
message: "#^Method PHPStan\\\\PhpDoc\\\\ResolvedPhpDocBlock\\:\\:getNameScope\\(\\) should return PHPStan\\\\Analyser\\\\NameScope but returns PHPStan\\\\Analyser\\\\NameScope\\|null\\.$#"
148153
count: 1

src/PhpDoc/PhpDocNodeResolver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use function array_reverse;
3737
use function count;
3838
use function in_array;
39+
use function method_exists;
3940
use function strpos;
4041
use function substr;
4142

@@ -454,6 +455,10 @@ private function resolveAssertTagsFor(PhpDocNode $phpDocNode, NameScope $nameSco
454455

455456
public function resolveSelfOutTypeTag(PhpDocNode $phpDocNode, NameScope $nameScope): ?SelfOutTypeTag
456457
{
458+
if (!method_exists($phpDocNode, 'getSelfOutTypeTagValues')) {
459+
return null;
460+
}
461+
457462
foreach (['@phpstan-this-out', '@phpstan-self-out', '@psalm-this-out', '@psalm-self-out'] as $tagName) {
458463
foreach ($phpDocNode->getSelfOutTypeTagValues($tagName) as $selfOutTypeTagValue) {
459464
$type = $this->typeNodeResolver->resolve($selfOutTypeTagValue->type, $nameScope);

0 commit comments

Comments
 (0)