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

Commit 9572cae

Browse filesBrowse files
minor #49007 [HttpFoundation] Improve return type of Header::all (VincentLanglet)
This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [HttpFoundation] Improve return type of Header::all | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix phpstan/phpstan-symfony#264 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> The syntax is supported by PHPStorm since [youtrack.jetbrains.com/issue/WI-66465/Support-parsing-of-PhpStans-conditional-return-types](https://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: - I found a non prefixed version: https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php#L162 - I found multiple prefixed version like: https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/HttpFoundation/Request.php#L1437 Commits ------- 2f490ac [HttpFoundation] Improve return type of Header::all
2 parents 8278947 + 2f490ac commit 9572cae
Copy full SHA for 9572cae

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎src/Symfony/Component/HttpFoundation/HeaderBag.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/HeaderBag.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function __toString(): string
6363
*
6464
* @param string|null $key The name of the headers to return or null to get them all
6565
*
66-
* @return array<string, array<int, string|null>>|array<int, string|null>
66+
* @return ($key is null ? array<string, array<int, string|null>> : array<int, string|null>)
6767
*/
6868
public function all(string $key = null): array
6969
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.