You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
final class NullsafeMethodCallRule implements Rule
{
public function getNodeType(): string
{
return Node\Expr\NullsafeMethodCall::class;
}
public function processNode(Node $node, Scope $scope): array
{
$calledOnType = $scope->getScopeType($node->var);
if (!$calledOnType->isNull()->no()) {
return [];
}
return [
RuleErrorBuilder::message(sprintf('Using nullsafe method call on non-nullable type %s. Use -> instead.', $calledOnType->describe(VerbosityLevel::typeOnly())))