Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compiler/build/scoper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,7 @@ function (string $filePath, string $prefix, string $content): string {
'PhpParser\*',
// mimics https://github.com/phpstan/phpstan-src/commit/23d5ca04ab6213f53a0e6c2e77857b23a73aa41d
'Hoa\*',
// @see https://github.com/rectorphp/rector/issues/2955
'OxidEsales\*',
],
];
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\FunctionLike;
use PhpParser\Node\Name;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\RectorDefinition\CodeSample;
use Rector\Core\RectorDefinition\RectorDefinition;
Expand Down Expand Up @@ -111,6 +112,10 @@ private function shouldSkip(Node $node): bool
return false;
}

if (! $node->name instanceof Name) {
return true;
}

$functionName = $this->getName($node->name);
if ($functionName === null) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ private function shouldSkipClass(Class_ $class, string $testCaseClassName): bool
return true;
}

/** @var PhpDocInfo $phpDocInfo */
/** @var PhpDocInfo|null $phpDocInfo */
$phpDocInfo = $class->getAttribute(AttributeKey::PHP_DOC_INFO);
if ($phpDocInfo === null) {
return true;
}

$seeTags = $phpDocInfo->getTagsByName('see');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,13 @@ public function refactor(Node $node): ?Node
return null;
}

/** @var FuncCall $firstArgumentValue */
/** @var FuncCall|Node $firstArgumentValue */
$firstArgumentValue = $node->args[0]->value;

if (! $firstArgumentValue instanceof FuncCall) {
return null;
}

$functionName = $this->getName($firstArgumentValue);
if (! isset(self::OLD_FUNCTIONS_TO_TYPES[$functionName])) {
return null;
Expand Down