Skip to content

Commit 3d54347

Browse files
committed
Reword return type deprecation message
It is triggered for all classes (not only Symfony-ones), so we cannot be precise on when it will be added. However, we must do a "call to action" to prepare users for Symfony 6 (and potentially other package releases).
1 parent 8c3bf3e commit 3d54347

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

DebugClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ public function checkAnnotations(\ReflectionClass $refl, string $class): array
560560
if ('docblock' === $this->patchTypes['force']) {
561561
$this->patchMethod($method, $returnType, $declaringFile, $normalizedType);
562562
} elseif ('' !== $declaringClass && $this->patchTypes['deprecations']) {
563-
$deprecations[] = sprintf('Method "%s::%s()" will return "%s" as of its next major version. Doing the same in %s "%s" will be required when upgrading.', $declaringClass, $method->name, $normalizedType, interface_exists($declaringClass) ? 'implementation' : 'child class', $className);
563+
$deprecations[] = sprintf('Method "%s::%s()" might add "%s" as a native return type declaration in the future. Do the same in %s "%s" now to avoid errors or add an explicit @return annotation to suppress this message.', $declaringClass, $method->name, $normalizedType, interface_exists($declaringClass) ? 'implementation' : 'child class', $className);
564564
}
565565
}
566566
}

0 commit comments

Comments
 (0)