| 1 | <?php declare(strict_types=1); |
||
| 5 | final class ProblemDetails implements \JsonSerializable |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var string |
||
| 9 | */ |
||
| 10 | private $title; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var int |
||
| 14 | */ |
||
| 15 | private $status; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string|null |
||
| 19 | */ |
||
| 20 | private $detail; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var array |
||
| 24 | */ |
||
| 25 | private $extensions; |
||
| 26 | |||
| 27 | 9 | public function __construct(string $title, int $status, ?string $detail, array $extensions = []) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * @return string |
||
| 37 | */ |
||
| 38 | public function getTitle(): string |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return int |
||
| 45 | */ |
||
| 46 | public function getStatus(): int |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return string |
||
| 53 | */ |
||
| 54 | public function getDetail(): string |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return array |
||
| 61 | */ |
||
| 62 | 3 | public function getExtensions(): array |
|
| 66 | |||
| 67 | /** |
||
| 68 | * Specify data which should be serialized to JSON |
||
| 69 | * |
||
| 70 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
| 71 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
| 72 | * which is a value of any type other than a resource. |
||
| 73 | * @since 5.4.0 |
||
| 74 | */ |
||
| 75 | public function jsonSerialize() |
||
| 79 | |||
| 80 | 6 | public function toArray(): array |
|
| 88 | } |
||
| 89 |