| 1 | <?php |
||
| 7 | class ClientException extends \Exception |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var array |
||
| 11 | */ |
||
| 12 | protected $errors; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * ClientException constructor. |
||
| 16 | * @param string|array $errors |
||
| 17 | * @param int $code |
||
| 18 | * @param Throwable|null $previous |
||
| 19 | */ |
||
| 20 | public function __construct($errors, $code = 0, Throwable $previous = null) |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | public function getErrors() |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @return string |
||
| 41 | */ |
||
| 42 | public function __toString() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param $errors |
||
| 49 | * @param string $errorString |
||
| 50 | * @param null|string $field |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | private function buildErrorString($errors, $errorString = '', string $field = null): string |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @param $key |
||
| 68 | * @param string $value |
||
| 69 | * @return string |
||
| 70 | */ |
||
| 71 | private function buildErrorLine($key, string $value): string |
||
| 75 | } |
||
| 76 |