@@ -79,6 +79,7 @@ |
||
| 79 | 79 | * |
| 80 | 80 | * @param string $url |
| 81 | 81 | * @param integer $requestDelay |
| 82 | + * @param string $options |
|
| 82 | 83 | * @throws InvaliArgumentException |
| 83 | 84 | */ |
| 84 | 85 | public function __construct($url, $requestDelay, $options) |
@@ -172,7 +172,7 @@ |
||
| 172 | 172 | ]); |
| 173 | 173 | |
| 174 | 174 | } catch (\GuzzleException $e) { |
| 175 | - die((string)$e->getResponse()->getBody()); |
|
| 175 | + die((string) $e->getResponse()->getBody()); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | } |
@@ -121,12 +121,12 @@ discard block |
||
| 121 | 121 | $curlMessage = 'Extension CURL is not loaded or not installed.'; |
| 122 | 122 | |
| 123 | 123 | // check if auth is null |
| 124 | - if (! is_object($auth) || null == $auth) { |
|
| 124 | + if (!is_object($auth) || null == $auth) { |
|
| 125 | 125 | trigger_error($authMessage, E_USER_ERROR); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | // check if extension is installed |
| 129 | - if (! extension_loaded('curl')) { |
|
| 129 | + if (!extension_loaded('curl')) { |
|
| 130 | 130 | trigger_error($curlMessage, E_USER_ERROR); |
| 131 | 131 | } |
| 132 | 132 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $headers['Content-Type'] = 'application/json'; |
| 188 | 188 | |
| 189 | 189 | // check if header is an array |
| 190 | - if (! is_array($headers)) { |
|
| 190 | + if (!is_array($headers)) { |
|
| 191 | 191 | $str = "The guzzle client headers must be an array."; |
| 192 | 192 | throw new \Exception($str); |
| 193 | 193 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | $path = ltrim($path, '/'); |
| 243 | 243 | |
| 244 | - return $path . '.json?auth='. $auth.'&'. http_build_query($options).''; |
|
| 244 | + return $path . '.json?auth=' . $auth . '&' . http_build_query($options) . ''; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /** |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | */ |
| 443 | 443 | private function writeEventLogs($logger, $eventData, $event, $path) |
| 444 | 444 | { |
| 445 | - if (! empty($eventData) || null != $eventData) { |
|
| 445 | + if (!empty($eventData) || null != $eventData) { |
|
| 446 | 446 | $logger->addDebug("path: {$path}", [ |
| 447 | 447 | 'DATA' => $eventData, |
| 448 | 448 | 'EVENT TYPE' => $event->getEventType() |
@@ -11,18 +11,18 @@ discard block |
||
| 11 | 11 | //$auth->setBaseURI('https://breweriesandroid-557fc.firebaseio.com/'); |
| 12 | 12 | //$auth->setServertoken('BTYdglBnqZHxPDok65sldGZW67n6RNKV2cJzXnJK'); |
| 13 | 13 | |
| 14 | - $test = array( |
|
| 15 | - "Name" => "prodotto test", |
|
| 16 | - "id" => 25, |
|
| 17 | - "desc" => 'prodotto test 25', |
|
| 14 | + $test = array( |
|
| 15 | + "Name" => "prodotto test", |
|
| 16 | + "id" => 25, |
|
| 17 | + "desc" => 'prodotto test 25', |
|
| 18 | 18 | "price" => '15.25', |
| 19 | 19 | 'status' => 'active' |
| 20 | - ); |
|
| 20 | + ); |
|
| 21 | 21 | $firebase = new Firebase($auth); |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | $firebase->setTimeout(10); |
| 25 | - $firebase->patch('test/-KWYAQQE8wYNtPhEgeLQ', $test); |
|
| 25 | + $firebase->patch('test/-KWYAQQE8wYNtPhEgeLQ', $test); |
|
| 26 | 26 | // |
| 27 | 27 | // $opt = [];//orderBy="$value"&startAt=50 |
| 28 | 28 | // $opt['orderBy'] ="$value"; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | // $firebase->get('qrcodesControls', $opt); |
| 32 | 32 | // // $firebase->delete('products3'); |
| 33 | 33 | |
| 34 | - print_r($firebase->getFirebaseData()); |
|
| 34 | + print_r($firebase->getFirebaseData()); |
|
| 35 | 35 | |
| 36 | 36 | echo $firebase->getOperation(); |
| 37 | 37 | echo $firebase->getStatus(); |
@@ -24,12 +24,12 @@ |
||
| 24 | 24 | |
| 25 | 25 | $now = time(); |
| 26 | 26 | |
| 27 | - $opt = [];//orderBy="$value"&startAt=50 |
|
| 28 | - $opt['orderBy'] ="timestamp"; |
|
| 29 | - $opt['startAt'] = $yesterday; |
|
| 30 | - $opt['endAt'] =$now; |
|
| 31 | - //$opt['equalTo'] ='2214791644'; |
|
| 32 | - //startAt="b"&endAt="b\uf8ff" |
|
| 27 | + $opt = [];//orderBy="$value"&startAt=50 |
|
| 28 | + $opt['orderBy'] ="timestamp"; |
|
| 29 | + $opt['startAt'] = $yesterday; |
|
| 30 | + $opt['endAt'] =$now; |
|
| 31 | + //$opt['equalTo'] ='2214791644'; |
|
| 32 | + //startAt="b"&endAt="b\uf8ff" |
|
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | function test(...$params){ |
@@ -24,15 +24,15 @@ |
||
| 24 | 24 | |
| 25 | 25 | $now = time(); |
| 26 | 26 | |
| 27 | - $opt = [];//orderBy="$value"&startAt=50 |
|
| 28 | - $opt['orderBy'] ="timestamp"; |
|
| 27 | + $opt = []; //orderBy="$value"&startAt=50 |
|
| 28 | + $opt['orderBy'] = "timestamp"; |
|
| 29 | 29 | $opt['startAt'] = $yesterday; |
| 30 | - $opt['endAt'] =$now; |
|
| 30 | + $opt['endAt'] = $now; |
|
| 31 | 31 | //$opt['equalTo'] ='2214791644'; |
| 32 | 32 | //startAt="b"&endAt="b\uf8ff" |
| 33 | 33 | |
| 34 | 34 | |
| 35 | -function test(...$params){ |
|
| 35 | +function test(...$params) { |
|
| 36 | 36 | // pass event to callback function |
| 37 | 37 | |
| 38 | 38 | print_r($params[0]); |
@@ -11,18 +11,18 @@ discard block |
||
| 11 | 11 | //$auth->setBaseURI('https://breweriesandroid-557fc.firebaseio.com/'); |
| 12 | 12 | //$auth->setServertoken('BTYdglBnqZHxPDok65sldGZW67n6RNKV2cJzXnJK'); |
| 13 | 13 | |
| 14 | - $test = array( |
|
| 15 | - "Name" => "prodotto test", |
|
| 16 | - "id" => 25, |
|
| 17 | - "desc" => 'prodotto test 25', |
|
| 14 | + $test = array( |
|
| 15 | + "Name" => "prodotto test", |
|
| 16 | + "id" => 25, |
|
| 17 | + "desc" => 'prodotto test 25', |
|
| 18 | 18 | "price" => '15.25', |
| 19 | 19 | 'status' => 'active' |
| 20 | - ); |
|
| 20 | + ); |
|
| 21 | 21 | $firebase = new Firebase($auth); |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | $firebase->setTimeout(10); |
| 25 | - $firebase->delete('test/-KWYARI4DZca5D8tUor7'); |
|
| 25 | + $firebase->delete('test/-KWYARI4DZca5D8tUor7'); |
|
| 26 | 26 | // |
| 27 | 27 | // $opt = [];//orderBy="$value"&startAt=50 |
| 28 | 28 | // $opt['orderBy'] ="$value"; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | // $firebase->get('qrcodesControls', $opt); |
| 32 | 32 | // // $firebase->delete('products3'); |
| 33 | 33 | |
| 34 | - print_r($firebase->getFirebaseData()); |
|
| 34 | + print_r($firebase->getFirebaseData()); |
|
| 35 | 35 | |
| 36 | 36 | echo $firebase->getOperation(); |
| 37 | 37 | echo $firebase->getStatus(); |