Skip to content

Commit

Permalink
Remove unused @throws tags and handling of never thrown exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
kick-the-bucket authored and derrabus committed Dec 2, 2020
1 parent 9eeb37e commit 7d0b2a7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 0 additions & 2 deletions JsonResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ public function setCallback($callback = null)
* @param string $json
*
* @return $this
*
* @throws \InvalidArgumentException
*/
public function setJson($json)
{
Expand Down
14 changes: 1 addition & 13 deletions Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,15 +504,7 @@ public function __clone()
*/
public function __toString()
{
try {
$content = $this->getContent();
} catch (\LogicException $e) {
if (\PHP_VERSION_ID >= 70400) {
throw $e;
}

return trigger_error($e, \E_USER_ERROR);
}
$content = $this->getContent();

$cookieHeader = '';
$cookies = [];
Expand Down Expand Up @@ -577,8 +569,6 @@ public function overrideGlobals()
*
* @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
*
* @throws \InvalidArgumentException When $trustedHeaderSet is invalid
*/
public static function setTrustedProxies(array $proxies, int $trustedHeaderSet)
{
Expand Down Expand Up @@ -1527,8 +1517,6 @@ public function getProtocolVersion()
* @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
*
* @throws \LogicException
*/
public function getContent($asResource = false)
{
Expand Down

0 comments on commit 7d0b2a7

Please sign in to comment.