Passed
Push — develop ( b01d73...15f880 )
by Benjamin
04:31
created
src/base/PluginTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
         $oauthClientId = $this->getClientId();
78 78
         $oauthClientSecret = $this->getClientSecret();
79 79
 
80
-        if(!empty($oauthClientId) && !empty($oauthClientSecret))
80
+        if (!empty($oauthClientId) && !empty($oauthClientSecret))
81 81
         {
82 82
             $token = Facebook::$plugin->getOauth()->getToken();
83 83
 
84
-            if($token)
84
+            if ($token)
85 85
             {
86 86
                 return true;
87 87
             }
@@ -94,13 +94,13 @@  discard block
 block discarded – undo
94 94
     {
95 95
         $clientId = Facebook::$plugin->getSettings()->oauthClientId;
96 96
 
97
-        if($clientId) {
97
+        if ($clientId) {
98 98
             return $clientId;
99 99
         } else {
100 100
             $plugin = Craft::$app->getPlugins()->getPlugin('facebook');
101 101
             $settings = $plugin->getSettings();
102 102
 
103
-            if(!empty($settings['oauthClientId']))
103
+            if (!empty($settings['oauthClientId']))
104 104
             {
105 105
                 return $settings['oauthClientId'];
106 106
             }
@@ -110,13 +110,13 @@  discard block
 block discarded – undo
110 110
     {
111 111
         $clientSecret = Facebook::$plugin->getSettings()->oauthClientSecret;
112 112
 
113
-        if($clientSecret) {
113
+        if ($clientSecret) {
114 114
             return $clientSecret;
115 115
         } else {
116 116
             $plugin = Craft::$app->getPlugins()->getPlugin('facebook');
117 117
             $settings = $plugin->getSettings();
118 118
 
119
-            if(!empty($settings['oauthClientSecret']))
119
+            if (!empty($settings['oauthClientSecret']))
120 120
             {
121 121
                 return $settings['oauthClientSecret'];
122 122
             }
Please login to merge, or discard this patch.
src/services/Api.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         try {
75 75
             $pageAccessTokenResponse = $this->get('/'.$facebookInsightsObjectId, ['fields' => 'access_token']);
76 76
 
77
-            if(empty($pageAccessTokenResponse['access_token'])) {
77
+            if (empty($pageAccessTokenResponse['access_token'])) {
78 78
                 throw new \Exception('Couldn’t retrieve page access token for '.$facebookInsightsObjectId);
79 79
             }
80 80
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     private function getClient($accessToken = null): Client
115 115
     {
116
-        if(!$accessToken) {
116
+        if (!$accessToken) {
117 117
             $token = Facebook::$plugin->getOauth()->getToken();
118 118
             $accessToken = $token->getToken();
119 119
         }
Please login to merge, or discard this patch.