Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[ErrorHandler] Add helper script to patch type declarations#42988

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

Merged
derrabus merged 1 commit intosymfony:5.4fromwouterj:patch-type-script
Sep 13, 2021

Conversation

@wouterj
Copy link
Member

@wouterjwouterj commentedSep 11, 2021
edited
Loading

QA
Branch?5.4
Bug fix?no
New feature?yes
Deprecations?no
Tickets-
LicenseMIT
Doc PRsymfony/symfony-docs#15802

While 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).

derrabus reacted with thumbs up emoji
@carsonbot
Copy link

Hey!

I think@fancyweb has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks a lot for this PR, I had something similar on my list!

@wouterjwouterjforce-pushed thepatch-type-script branch 2 times, most recently from0f8b7c1 to8311f21CompareSeptember 13, 2021 09:11
@wouterj
Copy link
MemberAuthor

PR updated, including the proposed changes. Also added some help information, and added a basic deprecation handling (I don't want to depend on PhpUnitBridge - but it's still good to show type deprecations imho).

Copy link
Member

@derrabusderrabus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you!

As a follow-up, I think it would be great if we could eat our own dogfood here and leverage that script of yours in our CI.

@derrabus
Copy link
Member

Thank you Wouter.

@derrabusderrabus merged commit152cee3 intosymfony:5.4Sep 13, 2021
wouterj added a commit to symfony/symfony-docs that referenced this pull requestSep 13, 2021
…ugClassLoader (wouterj)This PR was merged into the 5.4 branch.Discussion----------[5.4] Document the patch type functionality of the DebugClassLoaderThis 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#42988Commits-------fbf0adf Document DebugClassLoader type patch functionality
This was referencedNov 5, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@derrabusderrabusderrabus approved these changes

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

4 participants

@wouterj@carsonbot@derrabus@nicolas-grekas

[8]ページ先頭

©2009-2025 Movatter.jp