mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-21 16:02:23 +02:00
various fixes
This commit is contained in:
parent
8f3e90ba7f
commit
128910963a
@ -11,6 +11,8 @@ use PhpParser\Node\Expr\FuncCall;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Expr\StaticCall;
|
||||
use PhpParser\Node\FunctionLike;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Name;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Core\RectorDefinition\CodeSample;
|
||||
use Rector\Core\RectorDefinition\RectorDefinition;
|
||||
@ -111,6 +113,10 @@ PHP
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! $node->name instanceof Identifier && ! $node->name instanceof Name) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$functionName = $this->getName($node->name);
|
||||
if ($functionName === null) {
|
||||
return false;
|
||||
|
@ -107,8 +107,11 @@ PHP
|
||||
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');
|
||||
|
||||
|
@ -92,9 +92,13 @@ final class AssertTrueFalseInternalTypeToSpecificMethodRector extends AbstractPH
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user