1 | <?php namespace Phabricator\Response; |
||
18 | class ConduitResponse { |
||
19 | |||
20 | /** |
||
21 | * The raw result data |
||
22 | * |
||
23 | * @type array |
||
24 | */ |
||
25 | protected $result; |
||
26 | |||
27 | /** |
||
28 | * ConduitResponse constructor. |
||
29 | * |
||
30 | * @param string $result Raw JSON response |
||
31 | */ |
||
32 | 2 | public function __construct($result) { |
|
35 | |||
36 | /** |
||
37 | * Process the raw JSON response, given from conduit. |
||
38 | * Throw an exception when given JSON is malformed |
||
39 | * |
||
40 | * @param $rawResult |
||
41 | * |
||
42 | * @throws \BuildR\Foundation\Exception\RuntimeException |
||
43 | * |
||
44 | * @return mixed |
||
45 | */ |
||
46 | 4 | protected function processRawResponse($rawResult) { |
|
55 | |||
56 | /** |
||
57 | * Determines that the current response is successful or not |
||
58 | * |
||
59 | * @return bool |
||
60 | */ |
||
61 | 2 | public function isSuccessful() { |
|
64 | |||
65 | /** |
||
66 | * Determines that the current response is failed or not |
||
67 | * |
||
68 | * @return bool |
||
69 | */ |
||
70 | 2 | public function isFailed() { |
|
73 | |||
74 | /** |
||
75 | * Returns the error information from the response. Returns an empty string when |
||
76 | * the API is not provide textual information |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | 2 | public function getErrorInfo() { |
|
83 | |||
84 | /** |
||
85 | * Returns the error code from the API response, if tha request is not successes |
||
86 | * This is not valid "error code". The conduit API returns short (constant like) |
||
87 | * text, that represents the error, like: ERR_CERT_INVALID |
||
88 | * |
||
89 | * @return string |
||
90 | */ |
||
91 | 2 | public function getErrorCode() { |
|
94 | |||
95 | /** |
||
96 | * Returns the API response |
||
97 | * |
||
98 | * @return array |
||
99 | */ |
||
100 | 2 | public function getResult() { |
|
103 | |||
104 | } |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..