1 | <?php |
||
21 | class JCFirebase |
||
22 | { |
||
23 | public $firebaseURI; |
||
24 | |||
25 | public $rootPath; |
||
26 | |||
27 | public $requestHeader = array( |
||
28 | 'accept' => 'application/json', |
||
29 | 'contentType' => 'application/json; charset=utf-8', |
||
30 | 'dataType' => 'json' |
||
31 | ); |
||
32 | |||
33 | public $requestOptions = array(); |
||
34 | |||
35 | /** |
||
36 | * @var OAuth |
||
37 | */ |
||
38 | public $auth; |
||
39 | |||
40 | |||
41 | /** |
||
42 | * JCFirebase constructor. |
||
43 | * |
||
44 | * @param $firebaseURI |
||
45 | * @param OAuth $auth |
||
46 | * @param string $rootPath |
||
47 | */ |
||
48 | public function __construct($firebaseURI, OAuth $auth, $rootPath = '/') |
||
54 | |||
55 | |||
56 | /** |
||
57 | * @param $firebaseURI |
||
58 | * @param $jsonString |
||
59 | * @param string $rootPath |
||
60 | * @return JCFirebase |
||
61 | * @throws \Exception |
||
62 | */ |
||
63 | public static function fromJson($firebaseURI, $jsonString, $rootPath = '/') |
||
67 | |||
68 | /** |
||
69 | * @param $firebaseURI |
||
70 | * @param $keyFile |
||
71 | * @param string $rootPath |
||
72 | * |
||
73 | * @return JCFirebase |
||
74 | * @throws \Exception |
||
75 | */ |
||
76 | public static function fromKeyFile($firebaseURI, $keyFile, $rootPath = '/') |
||
80 | |||
81 | 13 | public function getPathURI($path = '', $print = '') |
|
118 | |||
119 | 1 | public function getShallow($path = '', $options = array()) |
|
129 | |||
130 | /** |
||
131 | * @param string $path |
||
132 | * @param array $options |
||
133 | * |
||
134 | * @return JCResponse |
||
135 | */ |
||
136 | 7 | public function get($path = '', $options = array()) |
|
144 | |||
145 | /** |
||
146 | * @param string $path |
||
147 | * @param array $options |
||
148 | * |
||
149 | * @return JCResponse |
||
150 | */ |
||
151 | 7 | public function put($path = '', $options = array()) |
|
158 | |||
159 | /** |
||
160 | * @param string $path |
||
161 | * @param array $options |
||
162 | * |
||
163 | * @return JCResponse |
||
164 | */ |
||
165 | 4 | public function post($path = '', $options = array()) |
|
173 | |||
174 | /** |
||
175 | * @param string $path |
||
176 | * @param array $options |
||
177 | * |
||
178 | * @return JCResponse |
||
179 | */ |
||
180 | 1 | public function patch($path = '', $options = array()) |
|
188 | |||
189 | /** |
||
190 | * @param string $path |
||
191 | * @param array $options |
||
192 | * |
||
193 | * @return JCResponse |
||
194 | */ |
||
195 | 2 | public function delete($path = '', $options = array()) |
|
203 | |||
204 | /** |
||
205 | * Function that check firebase authencation |
||
206 | * and configuration valid or not |
||
207 | * |
||
208 | * @return bool |
||
209 | */ |
||
210 | 1 | public function isValid() |
|
216 | |||
217 | 13 | protected function refreshToken() |
|
221 | |||
222 | 7 | protected function addDataToPathURI($path = '', $options = array(), $reqType = RequestType::GET) |
|
231 | |||
232 | 12 | protected function addDataToRequest($options = array(), $jsonEncode = false) |
|
246 | } |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.