Completed
Branch feature/filterStream (0e183d)
by Ventimiglia
02:14
created
src/Stream/StreamClient.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -79,6 +79,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Firebase.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -121,12 +121,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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()
Please login to merge, or discard this patch.
examples/patch.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,18 +11,18 @@  discard block
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
examples/filterstream.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@
 block discarded – undo
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){
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,15 +24,15 @@
 block discarded – undo
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]);
Please login to merge, or discard this patch.
examples/delete.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,18 +11,18 @@  discard block
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.