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

 add return type hints to EntityFactory#52234

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

Conversation

@xabbuh
Copy link
Member

QA
Branch?6.4
Bug fix?yes
New feature?no
Deprecations?no
Issues
LicenseMIT

seehttps://github.com/EasyCorp/EasyAdminBundle/actions/runs/6603120076/job/17935909075

@carsonbotcarsonbot added this to the6.4 milestoneOct 22, 2023
@xabbuhxabbuh changed the titleblock the doctrine bridge from being used with SecurityBundle 7[DoctrineBridge] block the bridge from being used with SecurityBundle 7Oct 22, 2023
@wouterj
Copy link
Member

wouterj commentedOct 22, 2023
edited
Loading

An alternative would be to add the native return type and document the BC break. We've done that for multiple other method implementations as well:#50890 GivenEntityFactory is a DI factory class, the likelihood of anyone being hit by this BC break seems rather slim.

nicolas-grekas, derrabus, and salehhashemi1992 reacted with thumbs up emoji

@nicolas-grekas
Copy link
Member

I like@wouterj's proposal!

@xabbuhxabbuhforce-pushed thedoctrine-bridge-conflict-security-bundle branch fromf7ec47e tob778bc9CompareOctober 22, 2023 14:19
@derrabus
Copy link
Member

Yes, let's do what@wouterj proposes. If someone complains about the BC break, we could still make the return type conditional using a trait, but I doubt that someone extends this class.

While we're at it, should we makeEntityFactory final in 7.0? There's really no point in extending it: It only exposes the public methods fromUserProviderFactoryInterface. If someone wants to extend the functionality of that class, a decorator would be the better way to do that.

@xabbuhxabbuh changed the title[DoctrineBridge] block the bridge from being used with SecurityBundle 7[DoctrineBridge] add return type hints to EntityFactoryOct 22, 2023
@xabbuhxabbuhforce-pushed thedoctrine-bridge-conflict-security-bundle branch fromb778bc9 to3ceed63CompareOctober 22, 2023 14:23
@xabbuh
Copy link
MemberAuthor

I have added the return types and also marked the class as final.

@carsonbotcarsonbot changed the title[DoctrineBridge] add return type hints to EntityFactory add return type hints to EntityFactoryOct 22, 2023
@smnandre
Copy link
Member

Is this the same problem there ?

PHP Fatal error: Declaration of Symfony\WebpackEncoreBundle\CacheWarmer\EntrypointCacheWarmer::doWarmUp($cacheDir, Symfony\Component\Cache\Adapter\ArrayAdapter $arrayAdapter): bool must be compatible with Symfony\Bundle\FrameworkBundle\CacheWarmer\AbstractPhpFileCacheWarmer::doWarmUp(string $cacheDir, Symfony\Component\Cache\Adapter\ArrayAdapter $arrayAdapter, ?string $buildDir = null): bool in /home/runner/work/ux/ux/src/Turbo/vendor/symfony/webpack-encore-bundle/src/CacheWarmer/EntrypointCacheWarmer.php on line 27

symfony/ux#1223

If so, could you explain what are the steps to fix ? (i must admit i'm not yet fluent in "multi-php multi-version multi-bundle" troubles 😅

@wouterj
Copy link
Member

wouterj commentedOct 22, 2023
edited
Loading

@smnandre that's a different issue: the first parameter$cacheDir must get thestring type in the WebpackEncoreBundle. Adding types to parameters can be done safely (it's not a BC break), as a child can have a less specific parameter type than its parent).

@smnandre
Copy link
Member

Thank you@wouterj !

@fabpot
Copy link
Member

Thank you@xabbuh.

@fabpotfabpot merged commitfafbbfa intosymfony:6.4Oct 22, 2023
@xabbuhxabbuh deleted the doctrine-bridge-conflict-security-bundle branchOctober 22, 2023 15:17
@derrabus
Copy link
Member

derrabus commentedOct 22, 2023
edited
Loading

the first parameter$cacheDir must get thestring type in the WebpackEncoreBundle

Actually, the issue is the new and optional third parameter. But, as@wouterj said, this is a different and unrelated problem. If you don't know how to solve it, please open a new issue or a dicussion.

smnandre reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@derrabusderrabusderrabus approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

6.4

Development

Successfully merging this pull request may close these issues.

7 participants

@xabbuh@wouterj@nicolas-grekas@derrabus@smnandre@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp