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

[Config] ConfigBuilderGenerator: define template types#54008

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

Open
thePanz wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromthePanz:patch-1

Conversation

thePanz
Copy link
Contributor

@thePanzthePanz commentedFeb 20, 2024
edited by OskarStark
Loading

QA
Branch?7.3
Bug fix?no
New feature?no
Deprecations?no
Issuesnone
LicenseMIT

This helps phpstan to properly identify the return types, in our case for the$framework->messenger()->transport('async')->dsn(env('MESSENGER_TRANSPORT_DSN'));

Where->dns() failed with the following Phpstan error:
Call to an undefined method Symfony\Config\Framework\Messenger\TransportConfig|Symfony\Config\Framework\MessengerConfig::dsn()

@carsonbotcarsonbot added this to the7.1 milestoneFeb 20, 2024
@thePanzthePanzforce-pushed thepatch-1 branch 3 times, most recently from2e524b4 toeca96b0CompareFebruary 20, 2024 12:36
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.

looks like we're missing a case where we have a union type as "of"

@carsonbotcarsonbot changed the titleConfigBuilderGenerator: define template types[Config] ConfigBuilderGenerator: define template typesFeb 20, 2024
This helps phpstan to properly identify the return types, in our case for the `$framework->messenger()->transport('async')->dsn(env('MESSENGER_TRANSPORT_DSN'));`Where  '->dns()` failed with the following Phpstan error:`Call to an undefined method Symfony\Config\Framework\Messenger\TransportConfig|Symfony\Config\Framework\MessengerConfig::dsn()`
@thePanz
Copy link
ContributorAuthor

looks like we're missing a case where we have a union type as "of"

true, all the test cases were only handlingmixed.
I would need some help here, maybe@wouterj as the previous editor of those lines can help? 🙏

@thePanz
Copy link
ContributorAuthor

Another issue we identified is the messenger routing configuration, which confuses PhpStan.
I have reproduced it here:https://phpstan.org/r/27a18bc2-2e96-499c-b456-f88803542f8f

But could not find a way to solve it, notes:

  • the $value is always an array
  • the value's check foris_array is not needed IMO

@xabbuhxabbuh modified the milestones:7.1,7.2May 15, 2024
@fabpotfabpot modified the milestones:7.2,7.3Nov 20, 2024
@robotomarvin
Copy link

robotomarvin commentedApr 27, 2025
edited
Loading

Another issue we identified is the messenger routing configuration, which confuses PhpStan. I have reproduced it here:https://phpstan.org/r/27a18bc2-2e96-499c-b456-f88803542f8f

But could not find a way to solve it, notes:

  • the $value is always an array
  • the value's check foris_array is not needed IMO

@thePanz for some reason PHPStan have two problems here that should be solved on PHPStan side (I think), conditional return on template does not work properly, and native return withstatic is overwriting conditional return type, this would work for PHPStan
https://phpstan.org/r/25fffe6f-8540-4c33-b49a-423b49b13ce0

I have also reported bug for the dead code / bad native typing to$value here#60282

Edit: this would also work for PHPStan even with conditional return based on genericshttps://phpstan.org/r/9ecae399-0ee4-4deb-9dc5-a1f3db4017b0

@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

6 participants
@thePanz@robotomarvin@nicolas-grekas@fabpot@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp