Primo Committ
This commit is contained in:
65
vendor/facade/flare-client-php/src/Http/Response.php
vendored
Normal file
65
vendor/facade/flare-client-php/src/Http/Response.php
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Facade\FlareClient\Http;
|
||||
|
||||
class Response
|
||||
{
|
||||
private $headers;
|
||||
|
||||
private $body;
|
||||
|
||||
private $error;
|
||||
|
||||
public function __construct($headers, $body, $error)
|
||||
{
|
||||
$this->headers = $headers;
|
||||
|
||||
$this->body = $body;
|
||||
|
||||
$this->error = $error;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getHeaders()
|
||||
{
|
||||
return $this->headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getBody()
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasBody()
|
||||
{
|
||||
return $this->body != false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getError()
|
||||
{
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|int
|
||||
*/
|
||||
public function getHttpResponseCode()
|
||||
{
|
||||
if (! isset($this->headers['http_code'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
return (int) $this->headers['http_code'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user