first commit

This commit is contained in:
René Preuß
2021-07-19 20:55:01 +02:00
commit f42347aa99
33 changed files with 8074 additions and 0 deletions

30
app/Bunny/Result.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
namespace App\Bunny;
use Psr\Http\Message\ResponseInterface;
class Result
{
private ResponseInterface $response;
private $data;
public function __construct(ResponseInterface $response)
{
$this->response = $response;
$this->data = json_decode($this->response->getBody()->getContents(), false);
}
public function getData()
{
return $this->data;
}
public function success(): bool
{
return in_array(floor($this->response->getStatusCode() / 100), [2]);
}
}