Skip to content

Commit 37d0d78

Browse files
Add more nullsafe operators
1 parent 50453e1 commit 37d0d78

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

DebugClassLoader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array
553553
$this->patchReturnTypeWillChange($method);
554554
}
555555

556-
if (null !== ($returnType ?? $returnType = self::MAGIC_METHODS[$method->name] ?? null) && !$method->hasReturnType() && !isset($doc['return'])) {
556+
if (null !== ($returnType ??= self::MAGIC_METHODS[$method->name] ?? null) && !$method->hasReturnType() && !isset($doc['return'])) {
557557
[$normalizedType, $returnType, $declaringClass, $declaringFile] = \is_string($returnType) ? [$returnType, $returnType, '', ''] : $returnType;
558558

559559
if ($canAddReturnType && 'docblock' !== $this->patchTypes['force']) {
@@ -935,10 +935,10 @@ private function patchMethod(\ReflectionMethod $method, string $returnType, stri
935935
continue;
936936
}
937937

938-
[$namespace, $useOffset, $useMap] = $useStatements[$file] ?? $useStatements[$file] = self::getUseStatements($file);
938+
[$namespace, $useOffset, $useMap] = $useStatements[$file] ??= self::getUseStatements($file);
939939

940940
if ('\\' !== $type[0]) {
941-
[$declaringNamespace, , $declaringUseMap] = $useStatements[$declaringFile] ?? $useStatements[$declaringFile] = self::getUseStatements($declaringFile);
941+
[$declaringNamespace, , $declaringUseMap] = $useStatements[$declaringFile] ??= self::getUseStatements($declaringFile);
942942

943943
$p = strpos($type, '\\', 1);
944944
$alias = $p ? substr($type, 0, $p) : $type;

0 commit comments

Comments
 (0)