1 | <?php |
||
18 | class JCFirebase |
||
19 | { |
||
20 | public $firebaseURI; |
||
21 | public $firebaseDefaultPath; |
||
22 | public $requestHeader = array( |
||
23 | 'accept' => 'application/json', |
||
24 | 'contentType' => 'application/json; charset=utf-8', |
||
25 | 'dataType' => 'json' |
||
26 | ); |
||
27 | public $requestOptions = array(); |
||
28 | /** |
||
29 | * @var OAuth |
||
30 | */ |
||
31 | protected $auth; |
||
32 | |||
33 | |||
34 | /** |
||
35 | * JCFirebase constructor. |
||
36 | * |
||
37 | * @param $firebaseURI |
||
38 | * @param array $firebaseAuth |
||
39 | * @param string $firebaseDefaultPath |
||
40 | */ |
||
41 | public function __construct($firebaseURI, $firebaseAuth = array(), $firebaseDefaultPath = '/') |
||
47 | |||
48 | |||
49 | /** |
||
50 | * @param $firebaseURI |
||
51 | * @param $jsonString |
||
52 | * @param string $firebaseDefaultPath |
||
53 | * @return JCFirebase |
||
54 | * @throws \Exception |
||
55 | */ |
||
56 | public static function fromJson($firebaseURI, $jsonString, $firebaseDefaultPath = '/') |
||
70 | |||
71 | /** |
||
72 | * @param $firebaseURI |
||
73 | * @param $keyFile |
||
74 | * @param string $firebaseDefaultPath |
||
75 | * |
||
76 | * @return JCFirebase |
||
77 | * @throws \Exception |
||
78 | */ |
||
79 | public static function fromKeyFile($firebaseURI, $keyFile, $firebaseDefaultPath = '/') |
||
90 | |||
91 | public function setAuth($firebaseServiceAccount) |
||
97 | |||
98 | public function getPathURI($path = '', $print = '') |
||
135 | |||
136 | public function getShallow($path = '', $options = array()) |
||
146 | |||
147 | /** |
||
148 | * @param string $path |
||
149 | * @param array $options |
||
150 | * |
||
151 | * @return \Requests_Response |
||
152 | */ |
||
153 | public function get($path = '', $options = array()) |
||
160 | |||
161 | /** |
||
162 | * @param string $path |
||
163 | * @param array $options |
||
164 | * |
||
165 | * @return \Requests_Response |
||
166 | */ |
||
167 | public function put($path = '', $options = array()) |
||
172 | |||
173 | /** |
||
174 | * @param string $path |
||
175 | * @param array $options |
||
176 | * |
||
177 | * @return \Requests_Response |
||
178 | */ |
||
179 | public function post($path = '', $options = array()) |
||
184 | |||
185 | /** |
||
186 | * @param string $path |
||
187 | * @param array $options |
||
188 | * |
||
189 | * @return \Requests_Response |
||
190 | */ |
||
191 | public function patch($path = '', $options = array()) |
||
196 | |||
197 | /** |
||
198 | * @param string $path |
||
199 | * @param array $options |
||
200 | * |
||
201 | * @return \Requests_Response |
||
202 | */ |
||
203 | public function delete($path = '', $options = array()) |
||
208 | |||
209 | protected function refreshToken() |
||
213 | |||
214 | protected function addDataToPathURI($path = '', $options = array(), $reqType = JCFirebaseOption::REQ_TYPE_GET) |
||
225 | |||
226 | protected function addDataToRequest($options = array(), $jsonEncode = false) |
||
240 | } |
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.