Passed
Push — master ( bf1c32...1d6896 )
by Francis
01:20
created
libraries/GMailUtil.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@  discard block
 block discarded – undo
16 16
   }
17 17
 
18 18
   function __invoke(string $url, array $header=[], mixed $body=null):array {
19
-    if ($body != null) $body = json_encode($body);
19
+    if ($body != null) {
20
+      $body = json_encode($body);
21
+    }
20 22
 
21 23
     $ch = curl_init($url);
22 24
 
@@ -26,7 +28,9 @@  discard block
 block discarded – undo
26 28
     // Header.
27 29
     $header[] = 'Content-Type: application/json';
28 30
     $header[] = 'User-Agent: '.$this->userAgent;
29
-    if ($body != null) $header[] = 'Content-Length: '.strlen($body);
31
+    if ($body != null) {
32
+      $header[] = 'Content-Length: '.strlen($body);
33
+    }
30 34
     curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
31 35
     // Request Method and Body.
32 36
     if ($this->method == self::POST) {
Please login to merge, or discard this patch.
libraries/GMail.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,9 @@  discard block
 block discarded – undo
15 15
 
16 16
   function __construct($params=null) {
17 17
     get_instance()->load->splint('francis94c/ci-gmail', '%curl');
18
-    if ($params != null) $this->init($params);
18
+    if ($params != null) {
19
+      $this->init($params);
20
+    }
19 21
   }
20 22
 
21 23
   /**
@@ -39,7 +41,9 @@  discard block
 block discarded – undo
39 41
    */
40 42
   public function getAuthorizeUrl(string $scope, string $redirectUri=null, string $responseType='code', string $accessType='offline'):string {
41 43
     $redirectUri = $redirectUri ?? $this->redirectUri;
42
-    if ($scope == null) throw new Exception("GMail scope cannot be null");
44
+    if ($scope == null) {
45
+      throw new Exception("GMail scope cannot be null");
46
+    }
43 47
     return self::AUTH_URL . build_url_query([
44 48
       'client_id'     => $this->clientId,
45 49
       'redirect_uri'  => $redirectUri,
Please login to merge, or discard this patch.
helpers/curl_helper.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
    * @return string             [description]
11 11
    */
12 12
   function build_url_query(array $params, bool $urlEncode=true):?string {
13
-    if ($params == null) return null;
13
+    if ($params == null) {
14
+      return null;
15
+    }
14 16
     $queryString = '?';
15 17
     foreach($params as $key => $val) {
16 18
       $queryString .= $key."=".($urlEncode ? rawurlencode($val) : $val)."&";
Please login to merge, or discard this patch.