[http foundation] Improve statusTexts variable type in the Response stub (#258)

This commit is contained in:
Oleg Zhulnev 2022-06-05 11:08:58 +03:00 committed by GitHub
parent fa5fe8b129
commit fc9e68fded
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -4,6 +4,11 @@ namespace Symfony\Component\HttpFoundation;
class Response class Response
{ {
/**
* @var array<int, string>
*/
public static $statusTexts;
/** /**
* @throws \InvalidArgumentException When the HTTP status code is not valid * @throws \InvalidArgumentException When the HTTP status code is not valid
* @psalm-taint-sink html $content * @psalm-taint-sink html $content

View File

@ -0,0 +1,18 @@
@symfony-common
Feature: Response
Background:
Given I have Symfony plugin enabled
Scenario: MixedAssignment error about $statusTexts is not raised
Given I have the following code
"""
<?php
use Symfony\Component\HttpFoundation\Response;
$message = Response::$statusTexts[Response::HTTP_INTERNAL_SERVER_ERROR];
"""
When I run Psalm
Then I see no errors