Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #33283 [ErrorHandler] make DebugClassLoader able to add retur…
…n type declarations (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [ErrorHandler] make DebugClassLoader able to add return type declarations | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #33236 | License | MIT | Doc PR | - This is the current state of the patching logic I'm using in `DebugClassLoader`. I run it after a `composer i -o` with the excluded classes emptied. It's not perfect, it requires manual changes/review, but it did the job so far. Patching is enabled with the `SYMFONY_PATCH_TYPE_DECLARATIONS` env var. The value of the env var is an URL-encoded array, with the following parameters as of now: - `force=0/1/docblock`: - `0` adds return types only to non-BC breaking places: internal/final/test methods; - `1` adds return types everywhere possible, potentially breaking BC with child classes that didn't declare the return types before; - `docblock` adds `@return` annotations to opt-out from deprecation notices that `DebugClassLoader` trigger otherwise - the annotation meaning: "I know a return type should be used here instead of an annotation, but I can't add it for BC reasons for now". - `php71-compat=0/1`: to prevent using the `object` type when the code must be compatible with PHP 7.1 Commits ------- 72f6a97 [ErrorHandler] make DebugClassLoader able to add return type declarations
- Loading branch information
Showing
1 changed file
with
187 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters