Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[5.4] Document the patch type functionality of the DebugClassLoader#15802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice, thank again :)
We might want to tell about#[ReturnTypeWillChange] since the script is also able to add them according to what PHP 8.1 reports
The script won't miss any spot (or that's a bug), but it doesn't really care about CS nor parse errors. We might want to tell ppl to review the patch and suggest to use php-cs-fixer after the script ran.
Uh oh!
There was an error while loading.Please reload this page.
cc9df2f to89c9b45CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…tions (wouterj)This PR was merged into the 5.4 branch.Discussion----------[ErrorHandler] Add helper script to patch type declarations| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | no| New feature? | yes| Deprecations? | no| Tickets | -| License | MIT| Doc PR |symfony/symfony-docs#15802While trying out the patch functionality in my bundle (and simultaneously writing docs for it), I found that I would pretty much recommend to copy-paste the `.github/patch-types.php` script. So I made it a bit more generic and added it as an official script to the ErrorHandler component.Usage:```# important!$ composer dump-autoload -o# default usage$ ./vendor/bin/patch-type-declarations# if you're an OSS maintainer, you probably want:$ SYMFONY_PATCH_TYPE_DECLARATIONS="force=1&php=7.4" ./vendor/bin/patch-type-declarations# regex if you need to exclude a certain directory or class (defaults to "vendor/" by default)$ SYMFONY_PATCH_TYPE_EXCLUDE="{/vendor/|/path/to/excluded/}" ./vendor/bin/patch-type-declarations```For reference: I did not remove the `.github/patch-type.php` script. I don't think it's worth replacing all the exclusion rules in that script with a single regex.`@nicolas`-grekas please let me know if you think this makes sense (or if I'm interpreting the new functionality completely wrong).Commits-------9e6da7e [ErrorHandler] Add helper script to patch type declarations
89c9b45 toea5e392Compareea5e392 to0b2af4dCompare0b2af4d tofbf0adfComparewouterj commentedSep 13, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Sorry for jumping the gun a bit here, but I would really like this to be online tomorrow. Nicolas and Javier have looked at these changes and weren't completely opposed to them 😉 But if anyone has any improvements left, I'm happy to look at your PR. |
Uh oh!
There was an error while loading.Please reload this page.
This is a critical bit of functionality that we have to explain before the stabilization phase, in order to document for open source maintainers how to make their packages compatible with Symfony 6. When 6.0 is released, it is also an important feature to smooth upgrading for application users. This is why the main text focuses on application, and I added a special sidebar for OSS maintainers.
I wasn't sure about the location for this functionality, but I think it makes most sense in the "upgrade major" article (although it used to be a very generic document).
@nicolas-grekas and@derrabus as far as I know, you two have been most involved in this process. Please, if you have time, validate that feature is described correctly and that the "Recommended approach for OSS maintainers" is actually the recommended one :D
Refsymfony/symfony#42988