| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Metricool\Exceptions; |
| 6 |
|
| 7 |
class RestDataException extends \Exception |
| 8 |
{ |
| 9 |
protected array $data = []; |
| 10 |
protected int $statusCode = 400; |
| 11 |
|
| 12 |
public function setResponseCode(int $code): RestDataException |
| 13 |
{ |
| 14 |
$this->statusCode = $code; |
| 15 |
return $this; |
| 16 |
} |
| 17 |
|
| 18 |
public function getResponseCode(): int |
| 19 |
{ |
| 20 |
return $this->statusCode; |
| 21 |
} |
| 22 |
|
| 23 |
public function setData(array $data): RestDataException |
| 24 |
{ |
| 25 |
$this->data = $data; |
| 26 |
return $this; |
| 27 |
} |
| 28 |
|
| 29 |
public function getData(): array |
| 30 |
{ |
| 31 |
return $this->data; |
| 32 |
} |
| 33 |
} |
| 34 |
|