| Total Complexity | 9 |
| Total Lines | 76 |
| Duplicated Lines | 0 % |
| Changes | 4 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 7 | final class Error |
||
| 8 | { |
||
| 9 | protected string $id; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Links |
||
| 13 | * |
||
| 14 | * @var array<string,string> |
||
| 15 | */ |
||
| 16 | protected array $links; |
||
| 17 | |||
| 18 | protected int $status; |
||
| 19 | |||
| 20 | protected int $code; |
||
| 21 | |||
| 22 | protected string $title; |
||
| 23 | |||
| 24 | protected string $detail; |
||
| 25 | |||
| 26 | protected string $source; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Meta |
||
| 30 | * |
||
| 31 | * @var array<string,int|string> |
||
| 32 | */ |
||
| 33 | protected array $meta; |
||
| 34 | |||
| 35 | public function __construct() |
||
| 36 | { |
||
| 37 | $this->meta = []; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function getStatus(): int |
||
| 41 | { |
||
| 42 | return $this->status; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function setStatus(int $status): bool |
||
| 46 | { |
||
| 47 | $this->status = $status; |
||
| 48 | return true; |
||
| 49 | } |
||
| 50 | |||
| 51 | public function setTitle(string $title): bool |
||
| 55 | } |
||
| 56 | |||
| 57 | public function setDetail(string $detail): bool |
||
| 61 | } |
||
| 62 | |||
| 63 | public function setMeta(string $key, string $value): bool |
||
| 64 | { |
||
| 65 | $this->meta[$key] = $value; |
||
| 66 | return true; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @return array<string,mixed> |
||
| 71 | */ |
||
| 72 | public function toArray(): array |
||
| 83 | } |
||
| 84 | } |
||
| 85 |