| Total Complexity | 4 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 4 | class Validation extends Generic |
||
| 5 | { |
||
| 6 | protected $message = 'Validation Error'; |
||
| 7 | protected $details = []; |
||
| 8 | |||
| 9 | 2 | public function __construct($message = '', $code = 400, array $body = []) |
|
| 10 | { |
||
| 11 | 2 | parent::__construct($message, $code, $body); |
|
| 12 | 2 | if (!empty($body['data']['error']['message'])) { |
|
| 13 | 2 | $this->message = $body['data']['error']['message']; |
|
| 14 | } |
||
| 15 | 2 | if (!empty($body['data']['error']['data'])) { |
|
| 16 | 2 | $this->details = $body['data']['error']['data']; |
|
| 17 | } |
||
| 18 | 2 | } |
|
| 19 | |||
| 20 | 2 | public function getDetails() |
|
| 23 | } |
||
| 24 | } |
||
| 25 |