Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CS #119

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Authentication/Chain.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ public function __construct(array $authenticationChain = [])
{
foreach ($authenticationChain as $authentication) {
if (!$authentication instanceof Authentication) {
throw new \InvalidArgumentException(
'Members of the authentication chain must be of type Http\Message\Authentication'
);
throw new \InvalidArgumentException('Members of the authentication chain must be of type Http\Message\Authentication');
}
}

Expand Down
16 changes: 3 additions & 13 deletions src/Builder/ResponseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,7 @@ public function setHeadersFromString($headers)
if (!(is_string($headers)
|| (is_object($headers) && method_exists($headers, '__toString')))
) {
throw new \InvalidArgumentException(
sprintf(
'%s expects parameter 1 to be a string, %s given',
__METHOD__,
is_object($headers) ? get_class($headers) : gettype($headers)
)
);
throw new \InvalidArgumentException(sprintf('%s expects parameter 1 to be a string, %s given', __METHOD__, is_object($headers) ? get_class($headers) : gettype($headers)));
}

$this->setHeadersFromArray(explode("\r\n", $headers));
Expand All @@ -105,9 +99,7 @@ public function setStatus($statusLine)
{
$parts = explode(' ', $statusLine, 3);
if (count($parts) < 2 || 0 !== strpos(strtolower($parts[0]), 'http/')) {
throw new \InvalidArgumentException(
sprintf('"%s" is not a valid HTTP status line', $statusLine)
);
throw new \InvalidArgumentException(sprintf('"%s" is not a valid HTTP status line', $statusLine));
}

$reasonPhrase = count($parts) > 2 ? $parts[2] : '';
Expand All @@ -131,9 +123,7 @@ public function addHeader($headerLine)
{
$parts = explode(':', $headerLine, 2);
if (2 !== count($parts)) {
throw new \InvalidArgumentException(
sprintf('"%s" is not a valid HTTP header line', $headerLine)
);
throw new \InvalidArgumentException(sprintf('"%s" is not a valid HTTP header line', $headerLine));
}
$name = trim($parts[0]);
$value = trim($parts[1]);
Expand Down
5 changes: 1 addition & 4 deletions src/CookieUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public static function parseDate($dateValue)
return $date;
}

throw new UnexpectedValueException(sprintf(
'Unparseable cookie date string "%s"',
$dateValue
));
throw new UnexpectedValueException(sprintf('Unparseable cookie date string "%s"', $dateValue));
}
}