8000 minor #42935 [ErrorHandler] Reword return type deprecation message (w… · symfony/symfony@1ee9727 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ee9727

Browse files
minor #42935 [ErrorHandler] Reword return type deprecation message (wouterj)
This PR was merged into the 5.4 branch. Discussion ---------- [ErrorHandler] Reword return type deprecation message | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This deprecation 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). I do welcome suggestions for better wordings :) (i.e. is "php return type" clear?) Commits ------- b7d88cf Reword return type deprecation message
2 parents 2221f4e + b7d88cf commit 1ee9727

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

src/Symfony/Component/ErrorHandler/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)
0