minor #39246 [HttpFoundation] Throws cleanup (kick-the-bucket)
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpFoundation] Throws cleanup
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
The actual throw statements have been removed years ago, but the annotations stayed.
Such annotations fool static analysis tools to trigger false positives for unhandled exceptions.
Commits
-------
8b9b62048c
Remove unused @throws tags and handling of never thrown exceptions
This commit is contained in:
commit
1ea5a8c3ce
@ -133,8 +133,6 @@ class JsonResponse extends Response
|
|||||||
* @param string $json
|
* @param string $json
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
*
|
|
||||||
* @throws \InvalidArgumentException
|
|
||||||
*/
|
*/
|
||||||
public function setJson($json)
|
public function setJson($json)
|
||||||
{
|
{
|
||||||
|
@ -504,15 +504,7 @@ class Request
|
|||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString()
|
||||||
{
|
{
|
||||||
try {
|
$content = $this->getContent();
|
||||||
$content = $this->getContent();
|
|
||||||
} catch (\LogicException $e) {
|
|
||||||
if (\PHP_VERSION_ID >= 70400) {
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
|
|
||||||
return trigger_error($e, \E_USER_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
$cookieHeader = '';
|
$cookieHeader = '';
|
||||||
$cookies = [];
|
$cookies = [];
|
||||||
@ -577,8 +569,6 @@ class Request
|
|||||||
*
|
*
|
||||||
* @param array $proxies A list of trusted proxies, the string 'REMOTE_ADDR' will be replaced with $_SERVER['REMOTE_ADDR']
|
* @param array $proxies A list of trusted proxies, the string 'REMOTE_ADDR' will be replaced with $_SERVER['REMOTE_ADDR']
|
||||||
* @param int $trustedHeaderSet A bit field of Request::HEADER_*, to set which headers to trust from your proxies
|
* @param int $trustedHeaderSet A bit field of Request::HEADER_*, to set which headers to trust from your proxies
|
||||||
*
|
|
||||||
* @throws \InvalidArgumentException When $trustedHeaderSet is invalid
|
|
||||||
*/
|
*/
|
||||||
public static function setTrustedProxies(array $proxies, int $trustedHeaderSet)
|
public static function setTrustedProxies(array $proxies, int $trustedHeaderSet)
|
||||||
{
|
{
|
||||||
@ -1527,8 +1517,6 @@ class Request
|
|||||||
* @param bool $asResource If true, a resource will be returned
|
* @param bool $asResource If true, a resource will be returned
|
||||||
*
|
*
|
||||||
* @return string|resource The request body content or a resource to read the body stream
|
* @return string|resource The request body content or a resource to read the body stream
|
||||||
*
|
|
||||||
* @throws \LogicException
|
|
||||||
*/
|
*/
|
||||||
public function getContent($asResource = false)
|
public function getContent($asResource = false)
|
||||||
{
|
{
|
||||||
|
@ -53,12 +53,7 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
$content = $request->getContent();
|
||||||
$content = $request->getContent();
|
|
||||||
} catch (\LogicException $e) {
|
|
||||||
// the user already got the request content as a resource
|
|
||||||
$content = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sessionMetadata = [];
|
$sessionMetadata = [];
|
||||||
$sessionAttributes = [];
|
$sessionAttributes = [];
|
||||||
|
Reference in New Issue
Block a user