1 | <?php |
||
15 | class Response |
||
16 | { |
||
17 | /** |
||
18 | * The original value. |
||
19 | * |
||
20 | * @var mixed |
||
21 | */ |
||
22 | protected $original; |
||
23 | |||
24 | /** |
||
25 | * Default level. |
||
26 | * |
||
27 | * @var int |
||
28 | */ |
||
29 | protected $level = 0; |
||
30 | |||
31 | /** |
||
32 | * Default error message. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $msg = 'Request failed'; |
||
37 | |||
38 | /** |
||
39 | * Request has verfiy success. |
||
40 | * |
||
41 | * @var bool |
||
42 | */ |
||
43 | protected $success = false; |
||
44 | |||
45 | /** |
||
46 | * Initialize Instance. |
||
47 | * |
||
48 | * @param mixed $result |
||
49 | */ |
||
50 | 6 | public function __construct($result) |
|
54 | |||
55 | /** |
||
56 | * Has success. |
||
57 | * |
||
58 | * @return bool |
||
59 | */ |
||
60 | 2 | public function success() |
|
64 | |||
65 | /** |
||
66 | * Get message. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | 1 | public function message() |
|
74 | |||
75 | /** |
||
76 | * Get original value. |
||
77 | * |
||
78 | * @return mixed |
||
79 | */ |
||
80 | 1 | public function getOriginal() |
|
84 | |||
85 | /** |
||
86 | * Get level. |
||
87 | * |
||
88 | * @return int |
||
89 | */ |
||
90 | 1 | public function level($force = true) |
|
98 | |||
99 | /** |
||
100 | * Parse response. |
||
101 | * |
||
102 | * @param array|null $result |
||
103 | */ |
||
104 | 6 | protected function parseResult($result) |
|
115 | } |
||
116 |