mirror of
https://github.com/danog/psalm-plugin-symfony.git
synced 2024-11-30 04:29:10 +01:00
[http foundation] Improve statusTexts variable type in the Response stub (#258)
This commit is contained in:
parent
fa5fe8b129
commit
fc9e68fded
@ -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
|
||||||
|
18
tests/acceptance/acceptance/Response.feature
Normal file
18
tests/acceptance/acceptance/Response.feature
Normal 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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user