Completed
Push — master ( e26d56...fcd15c )
by Haridarshan
02:39
created
src/Instagram.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
     /**
74 74
      * Default Constructor
75 75
      * Instagram Configuration Data
76
-	 *
76
+     *
77 77
      * @param array $config
78
-	 *
79
-	 * @throws InstagramException|InvalidArgumentException
78
+     *
79
+     * @throws InstagramException|InvalidArgumentException
80 80
      */
81 81
     public function __construct(array $config = [])
82 82
     {
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             throw new InstagramException('Invalid Instagram Configuration data');
85 85
         }
86 86
 		
87
-		$this->app = new InstagramApp($config['ClientId'], $config['ClientSecret']);	
87
+        $this->app = new InstagramApp($config['ClientId'], $config['ClientSecret']);	
88 88
 		
89 89
         $this->setCallbackUrl($config['Callback']);
90 90
         $this->state = isset($config['State']) ? $config['State'] : substr(md5(rand()), 0, 7);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $this->client = HelperFactory::getInstance()->client(Constants::API_HOST);
93 93
     }
94 94
 	
95
-	/**
95
+    /**
96 96
      * Returns InstagramApp entity.
97 97
      *
98 98
      * @return InstagramApp
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
 	
105 105
     /**
106 106
      * Make URLs for user browser navigation
107
-	 *
107
+     *
108 108
      * @param array  $parameters
109
-	 *
109
+     *
110 110
      * @return string
111
-	 *
112
-	 * @throws InstagramException
111
+     *
112
+     * @throws InstagramException
113 113
      */
114 114
     public function getLoginUrl(array $parameters)
115 115
     {
@@ -122,21 +122,21 @@  discard block
 block discarded – undo
122 122
 		
123 123
         $this->scopes = $parameters['scope'];
124 124
 		
125
-		$loginUrl = new LoginUrl(
126
-			$this->getApp(),
127
-			$this->getCallbackUrl(),
128
-			$this->getState(),
129
-			$this->scopes
130
-		);
125
+        $loginUrl = new LoginUrl(
126
+            $this->getApp(),
127
+            $this->getCallbackUrl(),
128
+            $this->getState(),
129
+            $this->scopes
130
+        );
131 131
 		
132
-		return $loginUrl->loginUrl();
132
+        return $loginUrl->loginUrl();
133 133
     }
134 134
 	
135 135
     /**
136 136
      * Get the Oauth Access Token of a user from callback code
137
-	 *
137
+     *
138 138
      * @param string $code - Oauth2 Code returned with callback url after successfull login
139
-	 *
139
+     *
140 140
      * @return InstagramOAuth
141 141
      */
142 142
     public function oauth($code)
@@ -150,20 +150,20 @@  discard block
 block discarded – undo
150 150
             "state" => $this->state
151 151
         );
152 152
 		
153
-		$response = HelperFactory::getInstance()->request($this->client, Constants::API_TOKEN, $options, 'POST');
153
+        $response = HelperFactory::getInstance()->request($this->client, Constants::API_TOKEN, $options, 'POST');
154 154
 		
155 155
         $this->oauthResponse = new InstagramOAuth(
156
-			json_decode($response->getBody()->getContents())
157
-		);
156
+            json_decode($response->getBody()->getContents())
157
+        );
158 158
 		
159 159
         return $this->oauthResponse;
160 160
     }
161 161
 	
162 162
     /**
163 163
      * Setter: Callback Url
164
-	 *
164
+     *
165 165
      * @param string $url
166
-	 *
166
+     *
167 167
      * @return void
168 168
      */
169 169
     public function setCallbackUrl($url)
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	
174 174
     /**
175 175
      * Getter: Callback Url
176
-	 *
176
+     *
177 177
      * @return string
178 178
      */
179 179
     public function getCallbackUrl()
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 	
184 184
     /**
185 185
      * Get InstagramOAuth
186
-	 *
186
+     *
187 187
      * @return InstagramOAuth
188 188
      */
189 189
     public function getOAuth()
@@ -192,16 +192,16 @@  discard block
 block discarded – undo
192 192
             return $this->oauthResponse;
193 193
         }
194 194
 		
195
-		$accessToken = new stdClass;
196
-		$accessToken->access_token = null;
195
+        $accessToken = new stdClass;
196
+        $accessToken->access_token = null;
197 197
 		
198 198
         $this->oauthResponse = new InstagramOAuth($accessToken);
199 199
         return $this->oauthResponse;
200 200
     }
201 201
 	
202 202
     /**
203
-	 * Get Http Client
204
-	 *
203
+     * Get Http Client
204
+     *
205 205
      * @return Client
206 206
      */
207 207
     public function getHttpClient()
@@ -211,9 +211,9 @@  discard block
 block discarded – undo
211 211
 	
212 212
     /**
213 213
      * Set User Access Token
214
-	 *
214
+     *
215 215
      * @param string $token
216
-	 *
216
+     *
217 217
      * @return void
218 218
      */
219 219
     public function setAccessToken($token)
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	
226 226
     /**
227 227
      * Get state value
228
-	 *
228
+     *
229 229
      * @return string|mixed
230 230
      */
231 231
     public function getState()
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
     /**
237 237
      * Get a string containing the version of the library.
238
-	 *
238
+     *
239 239
      * @return string
240 240
      */
241 241
     public function getLibraryVersion()
Please login to merge, or discard this patch.