Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
minor CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
denixport authored and weierophinney committed May 7, 2012
1 parent 5f83cfd commit 385f9ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ protected function detectFileMimeType($file)
public function encodeFormData($boundary, $name, $value, $filename = null, $headers = array())
{
$ret = "--{$boundary}\r\n" .
'Content-Disposition: form-data; name="' . $name .'"';
'Content-Disposition: form-data; name="' . $name . '"';

if ($filename) {
$ret .= '; filename="' . $filename . '"';
Expand All @@ -1215,7 +1215,6 @@ public function encodeFormData($boundary, $name, $value, $filename = null, $head
$ret .= "{$hname}: {$hvalue}\r\n";
}
$ret .= "\r\n";

$ret .= "{$value}\r\n";

return $ret;
Expand Down Expand Up @@ -1298,4 +1297,4 @@ protected function doRequest(Http $uri, $method, $secure = false, $headers = arr

return $this->adapter->read();
}
}
}
14 changes: 8 additions & 6 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class Response extends Message implements ResponseDescription
public static function fromString($string)
{
$lines = explode("\r\n", $string);
if (!is_array($lines) || count($lines)==1) {
if (!is_array($lines) || count($lines) == 1) {
$lines = explode("\n", $string);
}

Expand Down Expand Up @@ -487,13 +487,15 @@ protected function decodeChunkedBody($body)

while (trim($body)) {
if (! preg_match("/^([\da-fA-F]+)[^\r\n]*\r\n/sm", $body, $m)) {
throw new Exception\RuntimeException("Error parsing body - doesn't seem to be a chunked message");
throw new Exception\RuntimeException(
"Error parsing body - doesn't seem to be a chunked message"
);
}

$length = hexdec(trim($m[1]));
$cut = strlen($m[0]);
$length = hexdec(trim($m[1]));
$cut = strlen($m[0]);
$decBody .= substr($body, $cut, $length);
$body = substr($body, $cut + $length + 2);
$body = substr($body, $cut + $length + 2);
}

return $decBody;
Expand Down Expand Up @@ -553,4 +555,4 @@ protected function decodeDeflate($body)
return gzinflate($body);
}
}
}
}

0 comments on commit 385f9ee

Please sign in to comment.