MAPG-199 fix issues found by PHPStan

This commit is contained in:
bence committed 2020-07-05 23:18:56 +02:00
1 parent 39d691fd7f
commit af98d71924
34 files changed
+89 -68

No files matched your search

+6 -6
View File
@@ -29,7 +29,7 @@ class Request implements IRequest
$this->method = $method;
}
public function setQuery($query)
public function setQuery($query): void
{
if (is_string($query)) {
$this->query = $query;
@@ -38,7 +38,7 @@ class Request implements IRequest
}
}
public function setHeaders(array $headers)
public function setHeaders(array $headers): void
{
$this->headers = array_merge($this->headers, $headers);
}
@@ -47,13 +47,13 @@ class Request implements IRequest
{
$ch = curl_init();
if ($this->method === self::HTTP_GET) {
$url = $this->url . '?' . $this->query;
} elseif ($this->method === self::HTTP_POST) {
$url = $this->url;
if ($this->method === self::HTTP_POST) {
$url = $this->url;
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->query);
} else {
$url = $this->url . '?' . $this->query;
}
curl_setopt($ch, CURLOPT_URL, $url);
+2 -2
View File
@@ -14,12 +14,12 @@ class Response implements IResponse
$this->headers = $headers;
}
public function getBody()
public function getBody(): string
{
return $this->body;
}
public function getHeaders()
public function getHeaders(): array
{
return $this->headers;
}