Upgrade framework
This commit is contained in:
1 parent
1648a5cd42
commit
4fcf6fffcc
10548 files changed
+693131
-466691
No files matched your search
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\FlareClient\Http;
|
||||
|
||||
class Response
|
||||
{
|
||||
protected mixed $headers;
|
||||
|
||||
protected mixed $body;
|
||||
|
||||
protected mixed $error;
|
||||
|
||||
public function __construct(mixed $headers, mixed $body, mixed $error)
|
||||
{
|
||||
$this->headers = $headers;
|
||||
|
||||
$this->body = $body;
|
||||
|
||||
$this->error = $error;
|
||||
}
|
||||
|
||||
public function getHeaders(): mixed
|
||||
{
|
||||
return $this->headers;
|
||||
}
|
||||
|
||||
public function getBody(): mixed
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
public function hasBody(): bool
|
||||
{
|
||||
return $this->body != false;
|
||||
}
|
||||
|
||||
public function getError(): mixed
|
||||
{
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
public function getHttpResponseCode(): ?int
|
||||
{
|
||||
if (! isset($this->headers['http_code'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (int) $this->headers['http_code'];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user