@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | $servicename = $twitch->serviceName; |
25 | 25 | |
26 | 26 | // step 2: redirect to the provider's login screen |
27 | -if(isset($_GET['login']) && $_GET['login'] === $servicename){ |
|
27 | +if (isset($_GET['login']) && $_GET['login'] === $servicename) { |
|
28 | 28 | header('Location: '.$twitch->getAuthURL(null, $scopes)); |
29 | 29 | } |
30 | 30 | // step 3: receive the access token |
31 | -elseif(isset($_GET['code']) && isset($_GET['state'])){ |
|
31 | +elseif (isset($_GET['code']) && isset($_GET['state'])) { |
|
32 | 32 | $token = $twitch->getAccessToken($_GET['code'], $_GET['state']); |
33 | 33 | |
34 | 34 | // save the token [...] |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | header('Location: ?granted='.$servicename); |
38 | 38 | } |
39 | 39 | // step 4: verify the token and use the API |
40 | -elseif(isset($_GET['granted']) && $_GET['granted'] === $servicename){ |
|
41 | - echo '<pre>'.print_r(Psr7\get_json($twitch->me()),true).'</pre>'; |
|
40 | +elseif (isset($_GET['granted']) && $_GET['granted'] === $servicename) { |
|
41 | + echo '<pre>'.print_r(Psr7\get_json($twitch->me()), true).'</pre>'; |
|
42 | 42 | } |
43 | 43 | // step 1 (optional): display a login link |
44 | -else{ |
|
44 | +else { |
|
45 | 45 | echo '<a href="?login='.$servicename.'">connect with '.$servicename.'!</a>'; |
46 | 46 | } |
47 | 47 |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | $servicename = $mixcloud->serviceName; |
23 | 23 | |
24 | 24 | // step 2: redirect to the provider's login screen |
25 | -if(isset($_GET['login']) && $_GET['login'] === $servicename){ |
|
25 | +if (isset($_GET['login']) && $_GET['login'] === $servicename) { |
|
26 | 26 | header('Location: '.$mixcloud->getAuthURL(null, $scopes)); |
27 | 27 | } |
28 | 28 | // step 3: receive the access token |
29 | -elseif(isset($_GET['code'])){ // mixcloud doesn't support <state> |
|
29 | +elseif (isset($_GET['code'])) { // mixcloud doesn't support <state> |
|
30 | 30 | $token = $mixcloud->getAccessToken($_GET['code']); |
31 | 31 | |
32 | 32 | // save the token [...] |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | header('Location: ?granted='.$servicename); |
36 | 36 | } |
37 | 37 | // step 4: verify the token and use the API |
38 | -elseif(isset($_GET['granted']) && $_GET['granted'] === $servicename){ |
|
38 | +elseif (isset($_GET['granted']) && $_GET['granted'] === $servicename) { |
|
39 | 39 | echo '<pre>'.print_r(Psr7\get_json($mixcloud->me()), true).'</pre>'; |
40 | 40 | } |
41 | 41 | // step 1 (optional): display a login link |
42 | -else{ |
|
42 | +else { |
|
43 | 43 | echo '<a href="?login='.$servicename.'">connect with '.$servicename.'!</a>'; |
44 | 44 | } |
45 | 45 |
@@ -25,4 +25,4 @@ |
||
25 | 25 | |
26 | 26 | require_once __DIR__.'/../provider-example-common.php'; |
27 | 27 | |
28 | -$mixcloud = new \chillerlan\OAuth\Providers\Mixcloud\Mixcloud($http, $storage, $options, $logger); |
|
28 | +$mixcloud = new \chillerlan\OAuth\Providers\Mixcloud\Mixcloud($http, $storage, $options, $logger); |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | $servicename = $stripe->serviceName; |
28 | 28 | |
29 | 29 | // step 2: redirect to the provider's login screen |
30 | -if(isset($_GET['login']) && $_GET['login'] === $servicename){ |
|
30 | +if (isset($_GET['login']) && $_GET['login'] === $servicename) { |
|
31 | 31 | header('Location: '.$stripe->getAuthURL(null, $scopes)); |
32 | 32 | } |
33 | 33 | // step 3: receive the access token |
34 | -elseif(isset($_GET['code']) && isset($_GET['state'])){ |
|
34 | +elseif (isset($_GET['code']) && isset($_GET['state'])) { |
|
35 | 35 | $token = $stripe->getAccessToken($_GET['code'], $_GET['state']); |
36 | 36 | |
37 | 37 | // save the token [...] |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | header('Location: ?granted='.$servicename); |
41 | 41 | } |
42 | 42 | // step 4: verify the token and use the API |
43 | -elseif(isset($_GET['granted']) && $_GET['granted'] === $servicename){ |
|
43 | +elseif (isset($_GET['granted']) && $_GET['granted'] === $servicename) { |
|
44 | 44 | echo '<pre>'.print_r(Psr7\get_json($stripe->me()), true).'</pre>'; |
45 | 45 | } |
46 | 46 | // step 1 (optional): display a login link |
47 | -else{ |
|
47 | +else { |
|
48 | 48 | echo '<a href="?login='.$servicename.'">connect with '.$servicename.'!</a>'; |
49 | 49 | } |
50 | 50 |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | $servicename = $discogs->serviceName; |
22 | 22 | |
23 | 23 | // step 2: redirect to the provider's login screen |
24 | -if(isset($_GET['login']) && $_GET['login'] === $servicename){ |
|
24 | +if (isset($_GET['login']) && $_GET['login'] === $servicename) { |
|
25 | 25 | header('Location: '.$discogs->getAuthURL()); |
26 | 26 | } |
27 | 27 | // step 3: receive the access token |
28 | -elseif(isset($_GET['oauth_token']) && isset($_GET['oauth_verifier'])){ |
|
28 | +elseif (isset($_GET['oauth_token']) && isset($_GET['oauth_verifier'])) { |
|
29 | 29 | $token = $discogs->getAccessToken($_GET['oauth_token'], $_GET['oauth_verifier']); |
30 | 30 | |
31 | 31 | // save the token [...] |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | header('Location: ?granted='.$servicename); |
35 | 35 | } |
36 | 36 | // step 4: verify the token and use the API |
37 | -elseif(isset($_GET['granted']) && $_GET['granted'] === $servicename){ |
|
37 | +elseif (isset($_GET['granted']) && $_GET['granted'] === $servicename) { |
|
38 | 38 | echo '<pre>'.print_r(Psr7\get_json($discogs->identity()), true).'</pre>'; |
39 | 39 | } |
40 | 40 | // step 1 (optional): display a login link |
41 | -else{ |
|
41 | +else { |
|
42 | 42 | echo '<a href="?login='.$servicename.'">connect with '.$servicename.'!</a>'; |
43 | 43 | } |
44 | 44 |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | $servicename = $foursquare->serviceName; |
25 | 25 | |
26 | 26 | // step 2: redirect to the provider's login screen |
27 | -if(isset($_GET['login']) && $_GET['login'] === $servicename){ |
|
27 | +if (isset($_GET['login']) && $_GET['login'] === $servicename) { |
|
28 | 28 | header('Location: '.$foursquare->getAuthURL(null, $scopes)); |
29 | 29 | } |
30 | 30 | // step 3: receive the access token |
31 | -elseif(isset($_GET['code'])){ |
|
31 | +elseif (isset($_GET['code'])) { |
|
32 | 32 | $token = $foursquare->getAccessToken($_GET['code']); |
33 | 33 | |
34 | 34 | // save the token [...] |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | header('Location: ?granted='.$servicename); |
38 | 38 | } |
39 | 39 | // step 4: verify the token and use the API |
40 | -elseif(isset($_GET['granted']) && $_GET['granted'] === $servicename){ |
|
40 | +elseif (isset($_GET['granted']) && $_GET['granted'] === $servicename) { |
|
41 | 41 | echo '<pre>'.print_r(Psr7\get_json($foursquare->me()), true).'</pre>'; |
42 | 42 | } |
43 | 43 | // step 1 (optional): display a login link |
44 | -else{ |
|
44 | +else { |
|
45 | 45 | echo '<a href="?login='.$servicename.'">connect with '.$servicename.'!</a>'; |
46 | 46 | } |
47 | 47 |
@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | $servicename = $patreon1->serviceName; |
27 | 27 | |
28 | 28 | // step 2: redirect to the provider's login screen |
29 | -if(isset($_GET['login']) && $_GET['login'] === $servicename){ |
|
29 | +if (isset($_GET['login']) && $_GET['login'] === $servicename) { |
|
30 | 30 | header('Location: '.$patreon1->getAuthURL(null, $scopes)); |
31 | 31 | } |
32 | 32 | // step 3: receive the access token |
33 | -elseif(isset($_GET['code']) && isset($_GET['state'])){ |
|
33 | +elseif (isset($_GET['code']) && isset($_GET['state'])) { |
|
34 | 34 | $token = $patreon1->getAccessToken($_GET['code'], $_GET['state']); |
35 | 35 | |
36 | 36 | // save the token [...] |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | header('Location: ?granted='.$servicename); |
40 | 40 | } |
41 | 41 | // step 4: verify the token and use the API |
42 | -elseif(isset($_GET['granted']) && $_GET['granted'] === $servicename){ |
|
42 | +elseif (isset($_GET['granted']) && $_GET['granted'] === $servicename) { |
|
43 | 43 | echo '<pre>'.print_r(Psr7\get_json($patreon1->currentUser()), true).'</pre>'; |
44 | 44 | } |
45 | 45 | // step 1 (optional): display a login link |
46 | -else{ |
|
46 | +else { |
|
47 | 47 | echo '<a href="?login='.$servicename.'">connect with '.$servicename.'!</a>'; |
48 | 48 | } |
49 | 49 |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | $servicename = $patreon2->serviceName; |
31 | 31 | |
32 | 32 | // step 2: redirect to the provider's login screen |
33 | -if(isset($_GET['login']) && $_GET['login'] === $servicename){ |
|
33 | +if (isset($_GET['login']) && $_GET['login'] === $servicename) { |
|
34 | 34 | header('Location: '.$patreon2->getAuthURL(null, $scopes)); |
35 | 35 | } |
36 | 36 | // step 3: receive the access token |
37 | -elseif(isset($_GET['code']) && isset($_GET['state'])){ |
|
37 | +elseif (isset($_GET['code']) && isset($_GET['state'])) { |
|
38 | 38 | $token = $patreon2->getAccessToken($_GET['code'], $_GET['state']); |
39 | 39 | |
40 | 40 | // save the token [...] |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | header('Location: ?granted='.$servicename); |
44 | 44 | } |
45 | 45 | // step 4: verify the token and use the API |
46 | -elseif(isset($_GET['granted']) && $_GET['granted'] === $servicename){ |
|
46 | +elseif (isset($_GET['granted']) && $_GET['granted'] === $servicename) { |
|
47 | 47 | echo '<pre>'.print_r(Psr7\get_json($patreon2->identity(['fields[user]' => 'about,created,email,first_name,full_name,image_url,last_name,social_connections,thumb_url,url,vanity'])), true).'</pre>'; |
48 | 48 | } |
49 | 49 | // step 1 (optional): display a login link |
50 | -else{ |
|
50 | +else { |
|
51 | 51 | echo '<a href="?login='.$servicename.'">connect with '.$servicename.'!</a>'; |
52 | 52 | } |
53 | 53 |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | $servicename = $lastfm->serviceName; |
22 | 22 | |
23 | 23 | // step 2: redirect to the provider's login screen |
24 | -if(isset($_GET['login']) && $_GET['login'] === $servicename){ |
|
24 | +if (isset($_GET['login']) && $_GET['login'] === $servicename) { |
|
25 | 25 | header('Location: '.$lastfm->getAuthURL()); |
26 | 26 | } |
27 | 27 | // step 3: receive the access token |
28 | -elseif(isset($_GET['token'])){ |
|
28 | +elseif (isset($_GET['token'])) { |
|
29 | 29 | $token = $lastfm->getAccessToken($_GET['token']); |
30 | 30 | |
31 | 31 | // save the token [...] |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | header('Location: ?granted='.$servicename); |
35 | 35 | } |
36 | 36 | // step 4: verify the token and use the API |
37 | -elseif(isset($_GET['granted']) && $_GET['granted'] === $servicename){ |
|
37 | +elseif (isset($_GET['granted']) && $_GET['granted'] === $servicename) { |
|
38 | 38 | echo '<pre>'.print_r(Psr7\get_json($lastfm->userGetInfo()), true).'</pre>'; |
39 | 39 | } |
40 | 40 | // step 1 (optional): display a login link |
41 | -else{ |
|
41 | +else { |
|
42 | 42 | echo '<a href="?login='.$servicename.'">connect with '.$servicename.'!</a>'; |
43 | 43 | } |
44 | 44 |