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