[ErrorHandler] Turn return-type annotations into deprecations by default + add mode to turn them into native types #42623
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Leverages #42149
We need extensive doc on the topic for sure, a whole new chapter.
DebugClassLoader allows patching an app or a lib by going through these steps:
symfony/error-handler
if not already therecomposer install -q --optimize-autoloader
patch-types.php
SYMFONY_PATCH_TYPE_DECLARATIONS='force=phpdoc' php patch-types.php
SYMFONY_PATCH_TYPE_DECLARATIONS
can be set to:'force=phpdoc'
to copy@return
annotations from parent classes, to express that the next major version of that lib is going to add a native return types;'force=1'
to turn@return
annotations into native return types, but only on tests/private/final/internal methods;'force=2'
to turn@return
annotations into native return types, for all possible methods.