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

Appearance settings

[HttpFoundation] Improve return type of Header::all #49007

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

VincentLanglet
Copy link
Contributor

Q A
Branch? 6.3
Bug fix? no
New feature? no
Deprecations? no
Tickets Fix phpstan/phpstan-symfony#264
License MIT
Doc PR symfony/symfony-docs#...

The syntax is supported by PHPStorm since
youtrack.jetbrains.com/issue/WI-66465/Support-parsing-of-PhpStans-conditional-return-types

It's supported by psalm: https://psalm.dev/r/0c03bec576
And also by phpstan.

Not sure which syntax is preferred by Symfony:

@stof
Copy link
Member

stof commented Jan 24, 2023

The prefixed one is used in the Request object because @return still describes the native return type (as resource cannot be added as an actual native type). Otherwise, this would break our type patcher tool in the debug component.

src/Symfony/Component/HttpFoundation/HeaderBag.php Outdated Show resolved Hide resolved
@carsonbot carsonbot changed the title Improve return type of Header::all [HttpFoundation] Improve return type of Header::all Jan 26, 2023
@nicolas-grekas
Copy link
Member

Thank you @VincentLanglet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for HeaderBag::all()
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.