| Total Complexity | 10 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 85.71% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | final class Response |
||
| 17 | { |
||
| 18 | public const TYPE_ERROR = 0x8000; |
||
| 19 | |||
| 20 | private $header; |
||
| 21 | private $body; |
||
| 22 | |||
| 23 | 390 | public function __construct(array $header, array $body) |
|
| 24 | { |
||
| 25 | 390 | $this->header = $header; |
|
| 26 | 390 | $this->body = $body; |
|
| 27 | 390 | } |
|
| 28 | |||
| 29 | 324 | public function isError() : bool |
|
| 34 | } |
||
| 35 | |||
| 36 | 45 | public function getCode() : int |
|
| 39 | } |
||
| 40 | |||
| 41 | 345 | public function getSync() : int |
|
| 42 | { |
||
| 43 | 345 | return $this->header[Keys::SYNC]; |
|
| 44 | } |
||
| 45 | |||
| 46 | 3 | public function getSchemaId() : int |
|
| 47 | { |
||
| 48 | 3 | return $this->header[Keys::SCHEMA_ID]; |
|
| 49 | } |
||
| 50 | |||
| 51 | 317 | public function getBodyField(int $key) |
|
| 58 | } |
||
| 59 | |||
| 60 | public function tryGetBodyField(int $key, $default = null) |
||
| 63 | } |
||
| 64 | |||
| 65 | 6 | public function hasBodyField(int $key) : bool |
|
| 68 | } |
||
| 69 | } |
||
| 70 |