Skip to content

Commit c588ead

Browse files
committed
Use the nullsafe operator in build/PHPStan as NullsafeOperatorRule reports
Amp-Thread-ID: https://ampcode.com/threads/T-01a1cf65-c8c9-76e6-a6c6-639c9057ca36
1 parent aca08df commit c588ead

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎build/PHPStan/Build/InlineCallCollector.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ private function innerMembersArePublic(Expr $expr, ClassReflection $declaringCla
292292
$receivers = [$declaringClass];
293293
} elseif ($call->var instanceof Expr\Variable && is_string($call->var->name) && isset($paramNames[$call->var->name])) {
294294
$parameter = $parameters[$paramNames[$call->var->name]] ?? null;
295-
$receivers = $parameter === null ? null : $parameter->getType()->getObjectClassReflections();
295+
$receivers = $parameter?->getType()->getObjectClassReflections();
296296
} elseif ($call->var instanceof Expr\PropertyFetch && $call->var->var instanceof Expr\Variable && $call->var->var->name === 'this' && $call->var->name instanceof Node\Identifier) {
297297
$propertyName = $call->var->name->toString();
298298
$receivers = $declaringClass->hasNativeProperty($propertyName)

‎build/PHPStan/Build/NoScopeTypeReadInEngineRule.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function processNode(Node $node, Scope $scope): array
9393
}
9494

9595
$function = $scope->getFunction();
96-
$functionName = $function !== null ? $function->getName() : null;
96+
$functionName = $function?->getName();
9797
if (
9898
array_key_exists($namespace, self::ALLOWED_SEAMS)
9999
&& $functionName !== null

0 commit comments

Comments
 (0)