| Total Complexity | 3 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | class Error |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * Error constructor. |
||
| 21 | */ |
||
| 22 | public function __construct(protected string $reason, protected ?string $field) {} |
||
| 23 | |||
| 24 | /** |
||
| 25 | * What happened to cause this error. In most cases, this can be fixed immediately by |
||
| 26 | * changing the data you sent in the request, but in some cases you will be instructed to |
||
| 27 | * open a Support Ticket or perform some other action before you can complete the request |
||
| 28 | * successfully. |
||
| 29 | */ |
||
| 30 | 9 | public function getReason(): string |
|
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * The field in the request that caused this error. This may be a path, separated by |
||
| 37 | * periods in the case of nested fields. In some cases this may come back as "null" if the |
||
| 38 | * error is not specific to any single element of the request. |
||
| 39 | */ |
||
| 40 | 4 | public function getField(): ?string |
|
| 45 |