Set Psalm error level to 3; fix possibly null reason phrase in Response
This commit is contained in:
parent
29cfa34f17
commit
fe780e6b92
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<psalm
|
<psalm
|
||||||
errorLevel="4"
|
errorLevel="3"
|
||||||
resolveFromConfigFile="true"
|
resolveFromConfigFile="true"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns="https://getpsalm.org/schema/config"
|
xmlns="https://getpsalm.org/schema/config"
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ class Response extends Message implements ResponseInterface
|
||||||
{
|
{
|
||||||
/** @var string Text explanation of the HTTP Status Code. */
|
/** @var string Text explanation of the HTTP Status Code. */
|
||||||
private $reasonPhrase;
|
private $reasonPhrase;
|
||||||
/** @var int HTTP status code */
|
/** @var int HTTP status code */
|
||||||
private $statusCode;
|
private $statusCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -103,7 +103,7 @@ class Response extends Message implements ResponseInterface
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $statusCode
|
* @param int $statusCode
|
||||||
* @return string|null
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function getDefaultReasonPhraseForStatusCode($statusCode)
|
private function getDefaultReasonPhraseForStatusCode($statusCode)
|
||||||
{
|
{
|
||||||
|
|
@ -167,9 +167,6 @@ class Response extends Message implements ResponseInterface
|
||||||
510 => "Not Extended",
|
510 => "Not Extended",
|
||||||
511 => "Network Authentication Required"
|
511 => "Network Authentication Required"
|
||||||
];
|
];
|
||||||
if (isset($reasonPhraseLookup[$statusCode])) {
|
return $reasonPhraseLookup[$statusCode] ?? '';
|
||||||
return $reasonPhraseLookup[$statusCode];
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue