Passed
Pull Request — develop (#52)
by Peter
04:46
created
library/tiqr/Tiqr/Message/FCM.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     /**
46 46
      * @throws \Google\Exception
47 47
      */
48
-    private function getGoogleAccessToken($credentialsFile){
48
+    private function getGoogleAccessToken($credentialsFile) {
49 49
         $options = $this->getOptions();
50 50
         $client = new \Google_Client();
51 51
         $client->setAuthConfig($credentialsFile);
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      * @throws Tiqr_Message_Exception_SendFailure
67 67
      * @throws \Google\Exception
68 68
      */
69
-    private function _sendFirebase($deviceToken, $alert, $challenge, $projectId, $credentialsFile, $retry=false)
69
+    private function _sendFirebase($deviceToken, $alert, $challenge, $projectId, $credentialsFile, $retry = false)
70 70
     {
71 71
         $options = $this->getOptions();
72 72
         $apiurl = 'https://fcm.googleapis.com/v1/projects/'.$projectId.'/messages:send';
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         ];
86 86
 
87 87
         $headers = array(
88
-            'Authorization: Bearer ' . $this->getGoogleAccessToken($credentialsFile),
88
+            'Authorization: Bearer '.$this->getGoogleAccessToken($credentialsFile),
89 89
             'Content-Type: application/json',
90 90
         );
91 91
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $result = curl_exec($ch);
99 99
         $errors = curl_error($ch);
100 100
         $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
101
-        $remoteip = curl_getinfo($ch,CURLINFO_PRIMARY_IP);
101
+        $remoteip = curl_getinfo($ch, CURLINFO_PRIMARY_IP);
102 102
         curl_close($ch);
103 103
 
104 104
         if ($result === false) {
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         }
107 107
 
108 108
         if (!empty($errors)) {
109
-            throw new Tiqr_Message_Exception_SendFailure("Http error occurred: ". $errors, true);
109
+            throw new Tiqr_Message_Exception_SendFailure("Http error occurred: ".$errors, true);
110 110
         }
111 111
 
112 112
         // Wait and retry once in case of a 502 Bad Gateway error
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         $response = json_decode($result, true);
125 125
         foreach ($response['results'] as $k => $v) {
126 126
             if (isset($v['error'])) {
127
-                throw new Tiqr_Message_Exception_SendFailure("Error in FCM response: " . $v['error'], true);
127
+                throw new Tiqr_Message_Exception_SendFailure("Error in FCM response: ".$v['error'], true);
128 128
             }
129 129
         }
130 130
     }
Please login to merge, or discard this patch.