| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | 2 | public function jsonSerialize() |
|
| 47 | { |
||
| 48 | $error = [ |
||
| 49 | 2 | self::ERROR_CODE_FIELD => $this->getCode(), |
|
| 50 | 2 | self::ERROR_MESSAGE_FIELD => $this->getMessage(), |
|
| 51 | 2 | ]; |
|
| 52 | |||
| 53 | 2 | if (null !== ($data = $this->getData())) { |
|
| 54 | 1 | $error[self::ERROR_DATA_FIELD] = $data; |
|
| 55 | 1 | } |
|
| 56 | |||
| 57 | 2 | return $error; |
|
| 58 | } |
||
| 59 | } |
||
| 60 |