Skip to content

Commit cb43bdb

Browse files
committed
Temporary Rector fix
1 parent d00b45c commit cb43bdb

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/PhpDoc/PhpDocNodeResolver.php

+5
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);

src/Rules/PhpDoc/IncompatibleSelfOutTypeRule.php

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use PHPStan\ShouldNotHappenException;
1111
use PHPStan\Type\ObjectType;
1212
use PHPStan\Type\VerbosityLevel;
13+
use function sprintf;
1314

1415
/**
1516
* @implements Rule<InClassMethodNode>

0 commit comments

Comments
 (0)