Passed
Push — master ( 14fbd7...a7a005 )
by
unknown
55s queued 15s
created
src/Provider/Authentiq.php 2 patches
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -17,95 +17,95 @@
 block discarded – undo
17 17
  */
18 18
 class Authentiq extends OAuth2
19 19
 {
20
-    /**
21
-     * {@inheritdoc}
22
-     */
23
-    protected $scope = 'aq:name email~rs aq:push openid';
24
-
25
-    /**
26
-     * {@inheritdoc}
27
-     */
28
-    protected $apiBaseUrl = 'https://connect.authentiq.io/';
29
-
30
-    /**
31
-     * {@inheritdoc}
32
-     */
33
-    protected $authorizeUrl = 'https://connect.authentiq.io/authorize';
34
-
35
-    /**
36
-     * {@inheritdoc}
37
-     */
38
-    protected $accessTokenUrl = 'https://connect.authentiq.io/token';
39
-
40
-    /**
41
-     * {@inheritdoc}
42
-     */
43
-    protected $apiDocumentation = 'http://developers.authentiq.io/';
44
-
45
-    /**
46
-     * {@inheritdoc}
47
-     */
48
-    protected function initialize()
49
-    {
50
-        parent::initialize();
51
-
52
-        $this->AuthorizeUrlParameters += [
53
-            'prompt' => 'consent'
54
-        ];
55
-
56
-        $this->tokenExchangeHeaders = [
57
-            'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret)
58
-        ];
59
-
60
-        $this->tokenRefreshHeaders = [
61
-            'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret)
62
-        ];
63
-    }
64
-
65
-    /**
66
-     * {@inheritdoc}
67
-     */
68
-    public function getUserProfile()
69
-    {
70
-        $response = $this->apiRequest('userinfo');
71
-
72
-        $data = new Data\Collection($response);
73
-
74
-        if (!$data->exists('sub')) {
75
-            throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
76
-        }
77
-
78
-        $userProfile = new User\Profile();
79
-
80
-        $userProfile->identifier = $data->get('sub');
81
-
82
-        $userProfile->displayName = $data->get('name');
83
-        $userProfile->firstName = $data->get('given_name');
84
-        // $userProfile->middleName  = $data->get('middle_name'); // not supported
85
-        $userProfile->lastName = $data->get('family_name');
86
-
87
-        if (!empty($userProfile->displayName)) {
88
-            $userProfile->displayName = join(' ', array($userProfile->firstName,
89
-                // $userProfile->middleName,
90
-                $userProfile->lastName));
91
-        }
92
-
93
-        $userProfile->email = $data->get('email');
94
-        $userProfile->emailVerified = $data->get('email_verified') ? $userProfile->email : '';
95
-
96
-        $userProfile->phone = $data->get('phone');
97
-        // $userProfile->phoneVerified = $data->get('phone_verified') ? $userProfile->phone : ''; // not supported
98
-
99
-        $userProfile->profileURL = $data->get('profile');
100
-        $userProfile->webSiteURL = $data->get('website');
101
-        $userProfile->photoURL = $data->get('picture');
102
-        $userProfile->gender = $data->get('gender');
103
-        $userProfile->address = $data->filter('address')->get('street_address');
104
-        $userProfile->city = $data->filter('address')->get('locality');
105
-        $userProfile->country = $data->filter('address')->get('country');
106
-        $userProfile->region = $data->filter('address')->get('region');
107
-        $userProfile->zip = $data->filter('address')->get('postal_code');
108
-
109
-        return $userProfile;
110
-    }
20
+	/**
21
+	 * {@inheritdoc}
22
+	 */
23
+	protected $scope = 'aq:name email~rs aq:push openid';
24
+
25
+	/**
26
+	 * {@inheritdoc}
27
+	 */
28
+	protected $apiBaseUrl = 'https://connect.authentiq.io/';
29
+
30
+	/**
31
+	 * {@inheritdoc}
32
+	 */
33
+	protected $authorizeUrl = 'https://connect.authentiq.io/authorize';
34
+
35
+	/**
36
+	 * {@inheritdoc}
37
+	 */
38
+	protected $accessTokenUrl = 'https://connect.authentiq.io/token';
39
+
40
+	/**
41
+	 * {@inheritdoc}
42
+	 */
43
+	protected $apiDocumentation = 'http://developers.authentiq.io/';
44
+
45
+	/**
46
+	 * {@inheritdoc}
47
+	 */
48
+	protected function initialize()
49
+	{
50
+		parent::initialize();
51
+
52
+		$this->AuthorizeUrlParameters += [
53
+			'prompt' => 'consent'
54
+		];
55
+
56
+		$this->tokenExchangeHeaders = [
57
+			'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret)
58
+		];
59
+
60
+		$this->tokenRefreshHeaders = [
61
+			'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret)
62
+		];
63
+	}
64
+
65
+	/**
66
+	 * {@inheritdoc}
67
+	 */
68
+	public function getUserProfile()
69
+	{
70
+		$response = $this->apiRequest('userinfo');
71
+
72
+		$data = new Data\Collection($response);
73
+
74
+		if (!$data->exists('sub')) {
75
+			throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
76
+		}
77
+
78
+		$userProfile = new User\Profile();
79
+
80
+		$userProfile->identifier = $data->get('sub');
81
+
82
+		$userProfile->displayName = $data->get('name');
83
+		$userProfile->firstName = $data->get('given_name');
84
+		// $userProfile->middleName  = $data->get('middle_name'); // not supported
85
+		$userProfile->lastName = $data->get('family_name');
86
+
87
+		if (!empty($userProfile->displayName)) {
88
+			$userProfile->displayName = join(' ', array($userProfile->firstName,
89
+				// $userProfile->middleName,
90
+				$userProfile->lastName));
91
+		}
92
+
93
+		$userProfile->email = $data->get('email');
94
+		$userProfile->emailVerified = $data->get('email_verified') ? $userProfile->email : '';
95
+
96
+		$userProfile->phone = $data->get('phone');
97
+		// $userProfile->phoneVerified = $data->get('phone_verified') ? $userProfile->phone : ''; // not supported
98
+
99
+		$userProfile->profileURL = $data->get('profile');
100
+		$userProfile->webSiteURL = $data->get('website');
101
+		$userProfile->photoURL = $data->get('picture');
102
+		$userProfile->gender = $data->get('gender');
103
+		$userProfile->address = $data->filter('address')->get('street_address');
104
+		$userProfile->city = $data->filter('address')->get('locality');
105
+		$userProfile->country = $data->filter('address')->get('country');
106
+		$userProfile->region = $data->filter('address')->get('region');
107
+		$userProfile->zip = $data->filter('address')->get('postal_code');
108
+
109
+		return $userProfile;
110
+	}
111 111
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
         ];
55 55
 
56 56
         $this->tokenExchangeHeaders = [
57
-            'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret)
57
+            'Authorization' => 'Basic '.base64_encode($this->clientId.':'.$this->clientSecret)
58 58
         ];
59 59
 
60 60
         $this->tokenRefreshHeaders = [
61
-            'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret)
61
+            'Authorization' => 'Basic '.base64_encode($this->clientId.':'.$this->clientSecret)
62 62
         ];
63 63
     }
64 64
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         $data = new Data\Collection($response);
73 73
 
74
-        if (!$data->exists('sub')) {
74
+        if ( ! $data->exists('sub')) {
75 75
             throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
76 76
         }
77 77
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         // $userProfile->middleName  = $data->get('middle_name'); // not supported
85 85
         $userProfile->lastName = $data->get('family_name');
86 86
 
87
-        if (!empty($userProfile->displayName)) {
87
+        if ( ! empty($userProfile->displayName)) {
88 88
             $userProfile->displayName = join(' ', array($userProfile->firstName,
89 89
                 // $userProfile->middleName,
90 90
                 $userProfile->lastName));
Please login to merge, or discard this patch.
src/Provider/SteemConnect.php 2 patches
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -17,54 +17,54 @@
 block discarded – undo
17 17
  */
18 18
 class SteemConnect extends OAuth2
19 19
 {
20
-    /**
21
-     * {@inheritdoc}
22
-     */
23
-    protected $scope = 'login,vote';
20
+	/**
21
+	 * {@inheritdoc}
22
+	 */
23
+	protected $scope = 'login,vote';
24 24
 
25
-    /**
26
-     * {@inheritdoc}
27
-     */
28
-    protected $apiBaseUrl = 'https://v2.steemconnect.com/';
25
+	/**
26
+	 * {@inheritdoc}
27
+	 */
28
+	protected $apiBaseUrl = 'https://v2.steemconnect.com/';
29 29
 
30
-    /**
31
-     * {@inheritdoc}
32
-     */
33
-    protected $authorizeUrl = 'https://v2.steemconnect.com/oauth2/authorize';
30
+	/**
31
+	 * {@inheritdoc}
32
+	 */
33
+	protected $authorizeUrl = 'https://v2.steemconnect.com/oauth2/authorize';
34 34
 
35
-    /**
36
-     * {@inheritdoc}
37
-     */
38
-    protected $accessTokenUrl = 'https://v2.steemconnect.com/api/oauth2/token';
35
+	/**
36
+	 * {@inheritdoc}
37
+	 */
38
+	protected $accessTokenUrl = 'https://v2.steemconnect.com/api/oauth2/token';
39 39
 
40
-    /**
41
-     * {@inheritdoc}
42
-     */
43
-    protected $apiDocumentation = 'https://steemconnect.com/';
40
+	/**
41
+	 * {@inheritdoc}
42
+	 */
43
+	protected $apiDocumentation = 'https://steemconnect.com/';
44 44
 
45
-    /**
46
-     * {@inheritdoc}
47
-     */
48
-    public function getUserProfile()
49
-    {
50
-        $response = $this->apiRequest('api/me');
45
+	/**
46
+	 * {@inheritdoc}
47
+	 */
48
+	public function getUserProfile()
49
+	{
50
+		$response = $this->apiRequest('api/me');
51 51
 
52
-        $data = new Data\Collection($response);
52
+		$data = new Data\Collection($response);
53 53
 
54
-        if (!$data->exists('result')) {
55
-            throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
56
-        }
54
+		if (!$data->exists('result')) {
55
+			throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
56
+		}
57 57
 
58
-        $userProfile = new User\Profile();
58
+		$userProfile = new User\Profile();
59 59
 
60
-        $data = $data->filter('result');
60
+		$data = $data->filter('result');
61 61
 
62
-        $userProfile->identifier = $data->get('id');
63
-        $userProfile->description = $data->get('about');
64
-        $userProfile->photoURL = $data->get('profile_image');
65
-        $userProfile->webSiteURL = $data->get('website');
66
-        $userProfile->displayName = $data->get('name');
62
+		$userProfile->identifier = $data->get('id');
63
+		$userProfile->description = $data->get('about');
64
+		$userProfile->photoURL = $data->get('profile_image');
65
+		$userProfile->webSiteURL = $data->get('website');
66
+		$userProfile->displayName = $data->get('name');
67 67
 
68
-        return $userProfile;
69
-    }
68
+		return $userProfile;
69
+	}
70 70
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 
52 52
         $data = new Data\Collection($response);
53 53
 
54
-        if (!$data->exists('result')) {
54
+        if ( ! $data->exists('result')) {
55 55
             throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
56 56
         }
57 57
 
Please login to merge, or discard this patch.
src/Provider/Strava.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -17,56 +17,56 @@
 block discarded – undo
17 17
  */
18 18
 class Strava extends OAuth2
19 19
 {
20
-    /**
21
-     * {@inheritdoc}
22
-     */
23
-    protected $scope = 'profile:read_all';
20
+	/**
21
+	 * {@inheritdoc}
22
+	 */
23
+	protected $scope = 'profile:read_all';
24 24
 
25
-    /**
26
-     * {@inheritdoc}
27
-     */
28
-    protected $apiBaseUrl = 'https://www.strava.com/api/v3/';
25
+	/**
26
+	 * {@inheritdoc}
27
+	 */
28
+	protected $apiBaseUrl = 'https://www.strava.com/api/v3/';
29 29
 
30
-    /**
31
-     * {@inheritdoc}
32
-     */
33
-    protected $authorizeUrl = 'https://www.strava.com/oauth/authorize';
30
+	/**
31
+	 * {@inheritdoc}
32
+	 */
33
+	protected $authorizeUrl = 'https://www.strava.com/oauth/authorize';
34 34
 
35
-    /**
36
-     * {@inheritdoc}
37
-     */
38
-    protected $accessTokenUrl = 'https://www.strava.com/oauth/token';
35
+	/**
36
+	 * {@inheritdoc}
37
+	 */
38
+	protected $accessTokenUrl = 'https://www.strava.com/oauth/token';
39 39
 
40
-    /**
41
-     * {@inheritdoc}
42
-     */
43
-    protected $apiDocumentation = 'https://developers.strava.com/docs/reference/';
40
+	/**
41
+	 * {@inheritdoc}
42
+	 */
43
+	protected $apiDocumentation = 'https://developers.strava.com/docs/reference/';
44 44
 
45
-    /**
46
-     * {@inheritdoc}
47
-     */
48
-    public function getUserProfile()
49
-    {
50
-        $response = $this->apiRequest('athlete');
45
+	/**
46
+	 * {@inheritdoc}
47
+	 */
48
+	public function getUserProfile()
49
+	{
50
+		$response = $this->apiRequest('athlete');
51 51
 
52
-        $data = new Data\Collection($response);
52
+		$data = new Data\Collection($response);
53 53
 
54
-        if (!$data->exists('id')) {
55
-            throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
56
-        }
54
+		if (!$data->exists('id')) {
55
+			throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
56
+		}
57 57
 
58
-        $userProfile = new User\Profile();
58
+		$userProfile = new User\Profile();
59 59
 
60
-        $userProfile->identifier = $data->get('id');
61
-        $userProfile->firstName = $data->get('firstname');
62
-        $userProfile->lastName = $data->get('lastname');
63
-        $userProfile->gender = $data->get('sex');
64
-        $userProfile->country = $data->get('country');
65
-        $userProfile->city = $data->get('city');
66
-        $userProfile->email = $data->get('email');
60
+		$userProfile->identifier = $data->get('id');
61
+		$userProfile->firstName = $data->get('firstname');
62
+		$userProfile->lastName = $data->get('lastname');
63
+		$userProfile->gender = $data->get('sex');
64
+		$userProfile->country = $data->get('country');
65
+		$userProfile->city = $data->get('city');
66
+		$userProfile->email = $data->get('email');
67 67
 
68
-        $userProfile->displayName = $userProfile->displayName ?: $data->get('username');
68
+		$userProfile->displayName = $userProfile->displayName ?: $data->get('username');
69 69
 
70
-        return $userProfile;
71
-    }
70
+		return $userProfile;
71
+	}
72 72
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 
52 52
         $data = new Data\Collection($response);
53 53
 
54
-        if (!$data->exists('id')) {
54
+        if ( ! $data->exists('id')) {
55 55
             throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
56 56
         }
57 57
 
Please login to merge, or discard this patch.
src/Provider/Yahoo.php 2 patches
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -22,83 +22,83 @@
 block discarded – undo
22 22
  */
23 23
 class Yahoo extends OAuth2
24 24
 {
25
-    /**
26
-     * {@inheritdoc}
27
-     */
28
-    protected $scope = 'profile';
29
-
30
-    /**
31
-     * {@inheritdoc}
32
-     */
33
-    protected $apiBaseUrl = 'https://api.login.yahoo.com/openid/v1/';
34
-
35
-    /**
36
-     * {@inheritdoc}
37
-     */
38
-    protected $authorizeUrl = 'https://api.login.yahoo.com/oauth2/request_auth';
39
-
40
-    /**
41
-     * {@inheritdoc}
42
-     */
43
-    protected $accessTokenUrl = 'https://api.login.yahoo.com/oauth2/get_token';
44
-
45
-    /**
46
-     * {@inheritdoc}
47
-     */
48
-    protected $apiDocumentation = 'https://developer.yahoo.com/oauth2/guide/';
49
-
50
-    /**
51
-     * Currently authenticated user
52
-     */
53
-    protected $userId = null;
54
-
55
-    /**
56
-     * {@inheritdoc}
57
-     */
58
-    protected function initialize()
59
-    {
60
-        parent::initialize();
61
-
62
-        $this->tokenExchangeHeaders = [
63
-            'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret)
64
-        ];
65
-
66
-        $this->tokenRefreshHeaders = $this->tokenExchangeHeaders;
67
-    }
68
-
69
-    /**
70
-     * {@inheritdoc}
71
-     */
72
-    public function getUserProfile()
73
-    {
74
-        $response = $this->apiRequest('userinfo');
75
-
76
-        $data = new Data\Collection($response);
77
-
78
-        if (!$data->exists('sub')) {
79
-            throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
80
-        }
81
-
82
-        $userProfile = new User\Profile();
83
-
84
-        $userProfile->identifier = $data->get('sub');
85
-        $userProfile->firstName = $data->get('given_name');
86
-        $userProfile->lastName = $data->get('family_name');
87
-        $userProfile->displayName = $data->get('name');
88
-        $userProfile->gender = $data->get('gender');
89
-        $userProfile->language = $data->get('locale');
90
-        $userProfile->email = $data->get('email');
91
-
92
-        $userProfile->emailVerified = $data->get('email_verified') ? $userProfile->email : '';
93
-
94
-        $profileImages = $data->get('profile_images');
95
-        if ($this->config->get('photo_size')) {
96
-            $prop = 'image' . $this->config->get('photo_size');
97
-        } else {
98
-            $prop = 'image192';
99
-        }
100
-        $userProfile->photoURL = $profileImages->$prop;
101
-
102
-        return $userProfile;
103
-    }
25
+	/**
26
+	 * {@inheritdoc}
27
+	 */
28
+	protected $scope = 'profile';
29
+
30
+	/**
31
+	 * {@inheritdoc}
32
+	 */
33
+	protected $apiBaseUrl = 'https://api.login.yahoo.com/openid/v1/';
34
+
35
+	/**
36
+	 * {@inheritdoc}
37
+	 */
38
+	protected $authorizeUrl = 'https://api.login.yahoo.com/oauth2/request_auth';
39
+
40
+	/**
41
+	 * {@inheritdoc}
42
+	 */
43
+	protected $accessTokenUrl = 'https://api.login.yahoo.com/oauth2/get_token';
44
+
45
+	/**
46
+	 * {@inheritdoc}
47
+	 */
48
+	protected $apiDocumentation = 'https://developer.yahoo.com/oauth2/guide/';
49
+
50
+	/**
51
+	 * Currently authenticated user
52
+	 */
53
+	protected $userId = null;
54
+
55
+	/**
56
+	 * {@inheritdoc}
57
+	 */
58
+	protected function initialize()
59
+	{
60
+		parent::initialize();
61
+
62
+		$this->tokenExchangeHeaders = [
63
+			'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret)
64
+		];
65
+
66
+		$this->tokenRefreshHeaders = $this->tokenExchangeHeaders;
67
+	}
68
+
69
+	/**
70
+	 * {@inheritdoc}
71
+	 */
72
+	public function getUserProfile()
73
+	{
74
+		$response = $this->apiRequest('userinfo');
75
+
76
+		$data = new Data\Collection($response);
77
+
78
+		if (!$data->exists('sub')) {
79
+			throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
80
+		}
81
+
82
+		$userProfile = new User\Profile();
83
+
84
+		$userProfile->identifier = $data->get('sub');
85
+		$userProfile->firstName = $data->get('given_name');
86
+		$userProfile->lastName = $data->get('family_name');
87
+		$userProfile->displayName = $data->get('name');
88
+		$userProfile->gender = $data->get('gender');
89
+		$userProfile->language = $data->get('locale');
90
+		$userProfile->email = $data->get('email');
91
+
92
+		$userProfile->emailVerified = $data->get('email_verified') ? $userProfile->email : '';
93
+
94
+		$profileImages = $data->get('profile_images');
95
+		if ($this->config->get('photo_size')) {
96
+			$prop = 'image' . $this->config->get('photo_size');
97
+		} else {
98
+			$prop = 'image192';
99
+		}
100
+		$userProfile->photoURL = $profileImages->$prop;
101
+
102
+		return $userProfile;
103
+	}
104 104
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         parent::initialize();
61 61
 
62 62
         $this->tokenExchangeHeaders = [
63
-            'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret)
63
+            'Authorization' => 'Basic '.base64_encode($this->clientId.':'.$this->clientSecret)
64 64
         ];
65 65
 
66 66
         $this->tokenRefreshHeaders = $this->tokenExchangeHeaders;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
         $data = new Data\Collection($response);
77 77
 
78
-        if (!$data->exists('sub')) {
78
+        if ( ! $data->exists('sub')) {
79 79
             throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
80 80
         }
81 81
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         $profileImages = $data->get('profile_images');
95 95
         if ($this->config->get('photo_size')) {
96
-            $prop = 'image' . $this->config->get('photo_size');
96
+            $prop = 'image'.$this->config->get('photo_size');
97 97
         } else {
98 98
             $prop = 'image192';
99 99
         }
Please login to merge, or discard this patch.
src/Provider/Steam.php 2 patches
Indentation   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -35,116 +35,116 @@
 block discarded – undo
35 35
  */
36 36
 class Steam extends OpenID
37 37
 {
38
-    /**
39
-     * {@inheritdoc}
40
-     */
41
-    protected $openidIdentifier = 'http://steamcommunity.com/openid';
42
-
43
-    /**
44
-     * {@inheritdoc}
45
-     */
46
-    protected $apiDocumentation = 'https://steamcommunity.com/dev';
47
-
48
-    /**
49
-     * {@inheritdoc}
50
-     */
51
-    public function authenticateFinish()
52
-    {
53
-        parent::authenticateFinish();
54
-
55
-        $userProfile = $this->storage->get($this->providerId . '.user');
56
-
57
-        $userProfile->identifier = str_ireplace([
58
-            'http://steamcommunity.com/openid/id/',
59
-            'https://steamcommunity.com/openid/id/',
60
-        ], '', $userProfile->identifier);
61
-
62
-        if (!$userProfile->identifier) {
63
-            throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
64
-        }
65
-
66
-        try {
67
-            $apiKey = $this->config->filter('keys')->get('secret');
68
-
69
-            // if api key is provided, we attempt to use steam web api
70
-            if ($apiKey) {
71
-                $result = $this->getUserProfileWebAPI($apiKey, $userProfile->identifier);
72
-            } else {
73
-                // otherwise we fallback to community data
74
-                $result = $this->getUserProfileLegacyAPI($userProfile->identifier);
75
-            }
76
-
77
-            // fetch user profile
78
-            foreach ($result as $k => $v) {
79
-                $userProfile->$k = $v ?: $userProfile->$k;
80
-            }
81
-        } catch (\Exception $e) {
82
-        }
83
-
84
-        // store user profile
85
-        $this->storage->set($this->providerId . '.user', $userProfile);
86
-    }
87
-
88
-    /**
89
-     * Fetch user profile on Steam web API
90
-     *
91
-     * @param $apiKey
92
-     * @param $steam64
93
-     *
94
-     * @return array
95
-     */
96
-    public function getUserProfileWebAPI($apiKey, $steam64)
97
-    {
98
-        $q = http_build_query(['key' => $apiKey, 'steamids' => $steam64]);
99
-        $apiUrl = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?' . $q;
100
-
101
-        $response = $this->httpClient->request($apiUrl);
102
-
103
-        $data = json_decode($response);
104
-
105
-        $data = isset($data->response->players[0]) ? $data->response->players[0] : null;
106
-
107
-        $data = new Data\Collection($data);
108
-
109
-        $userProfile = [];
110
-
111
-        $userProfile['displayName'] = (string)$data->get('personaname');
112
-        $userProfile['firstName'] = (string)$data->get('realname');
113
-        $userProfile['photoURL'] = (string)$data->get('avatarfull');
114
-        $userProfile['profileURL'] = (string)$data->get('profileurl');
115
-        $userProfile['country'] = (string)$data->get('loccountrycode');
116
-
117
-        return $userProfile;
118
-    }
119
-
120
-    /**
121
-     * Fetch user profile on community API
122
-     * @param $steam64
123
-     * @return array
124
-     */
125
-    public function getUserProfileLegacyAPI($steam64)
126
-    {
127
-        libxml_use_internal_errors(false);
128
-
129
-        $apiUrl = 'http://steamcommunity.com/profiles/' . $steam64 . '/?xml=1';
130
-
131
-        $response = $this->httpClient->request($apiUrl);
132
-
133
-        $data = new \SimpleXMLElement($response);
134
-
135
-        $data = new Data\Collection($data);
136
-
137
-        $userProfile = [];
138
-
139
-        $userProfile['displayName'] = (string)$data->get('steamID');
140
-        $userProfile['firstName'] = (string)$data->get('realname');
141
-        $userProfile['photoURL'] = (string)$data->get('avatarFull');
142
-        $userProfile['description'] = (string)$data->get('summary');
143
-        $userProfile['region'] = (string)$data->get('location');
144
-        $userProfile['profileURL'] = (string)$data->get('customURL')
145
-            ? 'http://steamcommunity.com/id/' . (string)$data->get('customURL')
146
-            : 'http://steamcommunity.com/profiles/' . $steam64;
147
-
148
-        return $userProfile;
149
-    }
38
+	/**
39
+	 * {@inheritdoc}
40
+	 */
41
+	protected $openidIdentifier = 'http://steamcommunity.com/openid';
42
+
43
+	/**
44
+	 * {@inheritdoc}
45
+	 */
46
+	protected $apiDocumentation = 'https://steamcommunity.com/dev';
47
+
48
+	/**
49
+	 * {@inheritdoc}
50
+	 */
51
+	public function authenticateFinish()
52
+	{
53
+		parent::authenticateFinish();
54
+
55
+		$userProfile = $this->storage->get($this->providerId . '.user');
56
+
57
+		$userProfile->identifier = str_ireplace([
58
+			'http://steamcommunity.com/openid/id/',
59
+			'https://steamcommunity.com/openid/id/',
60
+		], '', $userProfile->identifier);
61
+
62
+		if (!$userProfile->identifier) {
63
+			throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
64
+		}
65
+
66
+		try {
67
+			$apiKey = $this->config->filter('keys')->get('secret');
68
+
69
+			// if api key is provided, we attempt to use steam web api
70
+			if ($apiKey) {
71
+				$result = $this->getUserProfileWebAPI($apiKey, $userProfile->identifier);
72
+			} else {
73
+				// otherwise we fallback to community data
74
+				$result = $this->getUserProfileLegacyAPI($userProfile->identifier);
75
+			}
76
+
77
+			// fetch user profile
78
+			foreach ($result as $k => $v) {
79
+				$userProfile->$k = $v ?: $userProfile->$k;
80
+			}
81
+		} catch (\Exception $e) {
82
+		}
83
+
84
+		// store user profile
85
+		$this->storage->set($this->providerId . '.user', $userProfile);
86
+	}
87
+
88
+	/**
89
+	 * Fetch user profile on Steam web API
90
+	 *
91
+	 * @param $apiKey
92
+	 * @param $steam64
93
+	 *
94
+	 * @return array
95
+	 */
96
+	public function getUserProfileWebAPI($apiKey, $steam64)
97
+	{
98
+		$q = http_build_query(['key' => $apiKey, 'steamids' => $steam64]);
99
+		$apiUrl = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?' . $q;
100
+
101
+		$response = $this->httpClient->request($apiUrl);
102
+
103
+		$data = json_decode($response);
104
+
105
+		$data = isset($data->response->players[0]) ? $data->response->players[0] : null;
106
+
107
+		$data = new Data\Collection($data);
108
+
109
+		$userProfile = [];
110
+
111
+		$userProfile['displayName'] = (string)$data->get('personaname');
112
+		$userProfile['firstName'] = (string)$data->get('realname');
113
+		$userProfile['photoURL'] = (string)$data->get('avatarfull');
114
+		$userProfile['profileURL'] = (string)$data->get('profileurl');
115
+		$userProfile['country'] = (string)$data->get('loccountrycode');
116
+
117
+		return $userProfile;
118
+	}
119
+
120
+	/**
121
+	 * Fetch user profile on community API
122
+	 * @param $steam64
123
+	 * @return array
124
+	 */
125
+	public function getUserProfileLegacyAPI($steam64)
126
+	{
127
+		libxml_use_internal_errors(false);
128
+
129
+		$apiUrl = 'http://steamcommunity.com/profiles/' . $steam64 . '/?xml=1';
130
+
131
+		$response = $this->httpClient->request($apiUrl);
132
+
133
+		$data = new \SimpleXMLElement($response);
134
+
135
+		$data = new Data\Collection($data);
136
+
137
+		$userProfile = [];
138
+
139
+		$userProfile['displayName'] = (string)$data->get('steamID');
140
+		$userProfile['firstName'] = (string)$data->get('realname');
141
+		$userProfile['photoURL'] = (string)$data->get('avatarFull');
142
+		$userProfile['description'] = (string)$data->get('summary');
143
+		$userProfile['region'] = (string)$data->get('location');
144
+		$userProfile['profileURL'] = (string)$data->get('customURL')
145
+			? 'http://steamcommunity.com/id/' . (string)$data->get('customURL')
146
+			: 'http://steamcommunity.com/profiles/' . $steam64;
147
+
148
+		return $userProfile;
149
+	}
150 150
 }
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
     {
53 53
         parent::authenticateFinish();
54 54
 
55
-        $userProfile = $this->storage->get($this->providerId . '.user');
55
+        $userProfile = $this->storage->get($this->providerId.'.user');
56 56
 
57 57
         $userProfile->identifier = str_ireplace([
58 58
             'http://steamcommunity.com/openid/id/',
59 59
             'https://steamcommunity.com/openid/id/',
60 60
         ], '', $userProfile->identifier);
61 61
 
62
-        if (!$userProfile->identifier) {
62
+        if ( ! $userProfile->identifier) {
63 63
             throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
64 64
         }
65 65
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         }
83 83
 
84 84
         // store user profile
85
-        $this->storage->set($this->providerId . '.user', $userProfile);
85
+        $this->storage->set($this->providerId.'.user', $userProfile);
86 86
     }
87 87
 
88 88
     /**
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     public function getUserProfileWebAPI($apiKey, $steam64)
97 97
     {
98 98
         $q = http_build_query(['key' => $apiKey, 'steamids' => $steam64]);
99
-        $apiUrl = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?' . $q;
99
+        $apiUrl = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?'.$q;
100 100
 
101 101
         $response = $this->httpClient->request($apiUrl);
102 102
 
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
 
109 109
         $userProfile = [];
110 110
 
111
-        $userProfile['displayName'] = (string)$data->get('personaname');
112
-        $userProfile['firstName'] = (string)$data->get('realname');
113
-        $userProfile['photoURL'] = (string)$data->get('avatarfull');
114
-        $userProfile['profileURL'] = (string)$data->get('profileurl');
115
-        $userProfile['country'] = (string)$data->get('loccountrycode');
111
+        $userProfile['displayName'] = (string) $data->get('personaname');
112
+        $userProfile['firstName'] = (string) $data->get('realname');
113
+        $userProfile['photoURL'] = (string) $data->get('avatarfull');
114
+        $userProfile['profileURL'] = (string) $data->get('profileurl');
115
+        $userProfile['country'] = (string) $data->get('loccountrycode');
116 116
 
117 117
         return $userProfile;
118 118
     }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     {
127 127
         libxml_use_internal_errors(false);
128 128
 
129
-        $apiUrl = 'http://steamcommunity.com/profiles/' . $steam64 . '/?xml=1';
129
+        $apiUrl = 'http://steamcommunity.com/profiles/'.$steam64.'/?xml=1';
130 130
 
131 131
         $response = $this->httpClient->request($apiUrl);
132 132
 
@@ -136,14 +136,14 @@  discard block
 block discarded – undo
136 136
 
137 137
         $userProfile = [];
138 138
 
139
-        $userProfile['displayName'] = (string)$data->get('steamID');
140
-        $userProfile['firstName'] = (string)$data->get('realname');
141
-        $userProfile['photoURL'] = (string)$data->get('avatarFull');
142
-        $userProfile['description'] = (string)$data->get('summary');
143
-        $userProfile['region'] = (string)$data->get('location');
144
-        $userProfile['profileURL'] = (string)$data->get('customURL')
145
-            ? 'http://steamcommunity.com/id/' . (string)$data->get('customURL')
146
-            : 'http://steamcommunity.com/profiles/' . $steam64;
139
+        $userProfile['displayName'] = (string) $data->get('steamID');
140
+        $userProfile['firstName'] = (string) $data->get('realname');
141
+        $userProfile['photoURL'] = (string) $data->get('avatarFull');
142
+        $userProfile['description'] = (string) $data->get('summary');
143
+        $userProfile['region'] = (string) $data->get('location');
144
+        $userProfile['profileURL'] = (string) $data->get('customURL')
145
+            ? 'http://steamcommunity.com/id/'.(string) $data->get('customURL')
146
+            : 'http://steamcommunity.com/profiles/'.$steam64;
147 147
 
148 148
         return $userProfile;
149 149
     }
Please login to merge, or discard this patch.
src/Provider/DeviantArt.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -17,75 +17,75 @@
 block discarded – undo
17 17
  */
18 18
 class DeviantArt extends OAuth2
19 19
 {
20
-    /**
21
-     * {@inheritdoc}
22
-     */
23
-    protected $scope = 'user';
20
+	/**
21
+	 * {@inheritdoc}
22
+	 */
23
+	protected $scope = 'user';
24 24
 
25
-    /**
26
-     * {@inheritdoc}
27
-     */
28
-    protected $apiBaseUrl = 'https://www.deviantart.com/api/v1/oauth2/';
25
+	/**
26
+	 * {@inheritdoc}
27
+	 */
28
+	protected $apiBaseUrl = 'https://www.deviantart.com/api/v1/oauth2/';
29 29
 
30
-    /**
31
-     * {@inheritdoc}
32
-     */
33
-    protected $authorizeUrl = 'https://www.deviantart.com/oauth2/authorize';
30
+	/**
31
+	 * {@inheritdoc}
32
+	 */
33
+	protected $authorizeUrl = 'https://www.deviantart.com/oauth2/authorize';
34 34
 
35
-    /**
36
-     * {@inheritdoc}
37
-     */
38
-    protected $accessTokenUrl = 'https://www.deviantart.com/oauth2/token';
35
+	/**
36
+	 * {@inheritdoc}
37
+	 */
38
+	protected $accessTokenUrl = 'https://www.deviantart.com/oauth2/token';
39 39
 
40
-    /**
41
-     * {@inheritdoc}
42
-     */
43
-    protected $apiDocumentation = 'https://www.deviantart.com/developers/http/v1/20200519';
40
+	/**
41
+	 * {@inheritdoc}
42
+	 */
43
+	protected $apiDocumentation = 'https://www.deviantart.com/developers/http/v1/20200519';
44 44
 
45
-    /**
46
-     * {@inheritdoc}
47
-     */
48
-    protected function initialize()
49
-    {
50
-        parent::initialize();
45
+	/**
46
+	 * {@inheritdoc}
47
+	 */
48
+	protected function initialize()
49
+	{
50
+		parent::initialize();
51 51
 
52
-        if ($this->isRefreshTokenAvailable()) {
53
-            $this->tokenRefreshParameters += [
54
-                'client_id' => $this->clientId,
55
-                'client_secret' => $this->clientSecret,
56
-            ];
57
-        }
58
-    }
52
+		if ($this->isRefreshTokenAvailable()) {
53
+			$this->tokenRefreshParameters += [
54
+				'client_id' => $this->clientId,
55
+				'client_secret' => $this->clientSecret,
56
+			];
57
+		}
58
+	}
59 59
 
60
-    /**
61
-     * {@inheritdoc}
62
-     *
63
-     * See: https://www.deviantart.com/developers/http/v1/20200519/user_whoami/2413749853e66c5812c9beccc0ab3495
64
-     */
65
-    public function getUserProfile()
66
-    {
67
-        $response = $this->apiRequest('user/whoami');
60
+	/**
61
+	 * {@inheritdoc}
62
+	 *
63
+	 * See: https://www.deviantart.com/developers/http/v1/20200519/user_whoami/2413749853e66c5812c9beccc0ab3495
64
+	 */
65
+	public function getUserProfile()
66
+	{
67
+		$response = $this->apiRequest('user/whoami');
68 68
 
69
-        $data = new Data\Collection($response);
69
+		$data = new Data\Collection($response);
70 70
 
71
-        $userProfile = new User\Profile();
71
+		$userProfile = new User\Profile();
72 72
 
73
-        $full_name = explode(' ', $data->filter('profile')->get('real_name'));
74
-        if (count($full_name) < 2) {
75
-            $full_name[1] = '';
76
-        }
73
+		$full_name = explode(' ', $data->filter('profile')->get('real_name'));
74
+		if (count($full_name) < 2) {
75
+			$full_name[1] = '';
76
+		}
77 77
 
78
-        $userProfile->identifier = $data->get('userid');
79
-        $userProfile->displayName = $data->get('username');
80
-        $userProfile->profileURL = $data->get('usericon');
81
-        $userProfile->webSiteURL = $data->filter('profile')->get('website');
82
-        $userProfile->firstName = $full_name[0];
83
-        $userProfile->lastName = $full_name[1];
84
-        $userProfile->profileURL = $data->filter('profile')->filter('profile_pic')->get('url');
85
-        $userProfile->gender = $data->filter('details')->get('sex');
86
-        $userProfile->age = $data->filter('details')->get('age');
87
-        $userProfile->country = $data->filter('geo')->get('country');
78
+		$userProfile->identifier = $data->get('userid');
79
+		$userProfile->displayName = $data->get('username');
80
+		$userProfile->profileURL = $data->get('usericon');
81
+		$userProfile->webSiteURL = $data->filter('profile')->get('website');
82
+		$userProfile->firstName = $full_name[0];
83
+		$userProfile->lastName = $full_name[1];
84
+		$userProfile->profileURL = $data->filter('profile')->filter('profile_pic')->get('url');
85
+		$userProfile->gender = $data->filter('details')->get('sex');
86
+		$userProfile->age = $data->filter('details')->get('age');
87
+		$userProfile->country = $data->filter('geo')->get('country');
88 88
 
89
-        return $userProfile;
90
-    }
89
+		return $userProfile;
90
+	}
91 91
 }
Please login to merge, or discard this patch.
src/Provider/WindowsLive.php 2 patches
Indentation   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -17,87 +17,87 @@
 block discarded – undo
17 17
  */
18 18
 class WindowsLive extends OAuth2
19 19
 {
20
-    /**
21
-     * {@inheritdoc}
22
-     */
23
-    protected $scope = 'wl.basic wl.contacts_emails wl.emails wl.signin wl.share wl.birthday';
24
-
25
-    /**
26
-     * {@inheritdoc}
27
-     */
28
-    protected $apiBaseUrl = 'https://apis.live.net/v5.0/';
29
-
30
-    /**
31
-     * {@inheritdoc}
32
-     */
33
-    protected $authorizeUrl = 'https://login.live.com/oauth20_authorize.srf';
34
-
35
-    /**
36
-     * {@inheritdoc}
37
-     */
38
-    protected $accessTokenUrl = 'https://login.live.com/oauth20_token.srf';
39
-
40
-    /**
41
-     * {@inheritdoc}
42
-     */
43
-    protected $apiDocumentation = 'https://msdn.microsoft.com/en-us/library/hh243647.aspx';
44
-
45
-    /**
46
-     * {@inheritdoc}
47
-     */
48
-    public function getUserProfile()
49
-    {
50
-        $response = $this->apiRequest('me');
51
-
52
-        $data = new Data\Collection($response);
53
-
54
-        if (!$data->exists('id')) {
55
-            throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
56
-        }
57
-
58
-        $userProfile = new User\Profile();
59
-
60
-        $userProfile->identifier = $data->get('id');
61
-        $userProfile->displayName = $data->get('name');
62
-        $userProfile->firstName = $data->get('first_name');
63
-        $userProfile->lastName = $data->get('last_name');
64
-        $userProfile->gender = $data->get('gender');
65
-        $userProfile->profileURL = $data->get('link');
66
-        $userProfile->email = $data->filter('emails')->get('preferred');
67
-        $userProfile->emailVerified = $data->filter('emails')->get('account');
68
-        $userProfile->birthDay = $data->get('birth_day');
69
-        $userProfile->birthMonth = $data->get('birth_month');
70
-        $userProfile->birthYear = $data->get('birth_year');
71
-        $userProfile->language = $data->get('locale');
72
-
73
-        return $userProfile;
74
-    }
75
-
76
-    /**
77
-     * {@inheritdoc}
78
-     */
79
-    public function getUserContacts()
80
-    {
81
-        $response = $this->apiRequest('me/contacts');
82
-
83
-        $data = new Data\Collection($response);
84
-
85
-        if (!$data->exists('data')) {
86
-            throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
87
-        }
88
-
89
-        $contacts = [];
90
-
91
-        foreach ($data->filter('data')->toArray() as $idx => $entry) {
92
-            $userContact = new User\Contact();
93
-
94
-            $userContact->identifier = $entry->get('id');
95
-            $userContact->displayName = $entry->get('name');
96
-            $userContact->email = $entry->filter('emails')->get('preferred');
97
-
98
-            $contacts[] = $userContact;
99
-        }
100
-
101
-        return $contacts;
102
-    }
20
+	/**
21
+	 * {@inheritdoc}
22
+	 */
23
+	protected $scope = 'wl.basic wl.contacts_emails wl.emails wl.signin wl.share wl.birthday';
24
+
25
+	/**
26
+	 * {@inheritdoc}
27
+	 */
28
+	protected $apiBaseUrl = 'https://apis.live.net/v5.0/';
29
+
30
+	/**
31
+	 * {@inheritdoc}
32
+	 */
33
+	protected $authorizeUrl = 'https://login.live.com/oauth20_authorize.srf';
34
+
35
+	/**
36
+	 * {@inheritdoc}
37
+	 */
38
+	protected $accessTokenUrl = 'https://login.live.com/oauth20_token.srf';
39
+
40
+	/**
41
+	 * {@inheritdoc}
42
+	 */
43
+	protected $apiDocumentation = 'https://msdn.microsoft.com/en-us/library/hh243647.aspx';
44
+
45
+	/**
46
+	 * {@inheritdoc}
47
+	 */
48
+	public function getUserProfile()
49
+	{
50
+		$response = $this->apiRequest('me');
51
+
52
+		$data = new Data\Collection($response);
53
+
54
+		if (!$data->exists('id')) {
55
+			throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
56
+		}
57
+
58
+		$userProfile = new User\Profile();
59
+
60
+		$userProfile->identifier = $data->get('id');
61
+		$userProfile->displayName = $data->get('name');
62
+		$userProfile->firstName = $data->get('first_name');
63
+		$userProfile->lastName = $data->get('last_name');
64
+		$userProfile->gender = $data->get('gender');
65
+		$userProfile->profileURL = $data->get('link');
66
+		$userProfile->email = $data->filter('emails')->get('preferred');
67
+		$userProfile->emailVerified = $data->filter('emails')->get('account');
68
+		$userProfile->birthDay = $data->get('birth_day');
69
+		$userProfile->birthMonth = $data->get('birth_month');
70
+		$userProfile->birthYear = $data->get('birth_year');
71
+		$userProfile->language = $data->get('locale');
72
+
73
+		return $userProfile;
74
+	}
75
+
76
+	/**
77
+	 * {@inheritdoc}
78
+	 */
79
+	public function getUserContacts()
80
+	{
81
+		$response = $this->apiRequest('me/contacts');
82
+
83
+		$data = new Data\Collection($response);
84
+
85
+		if (!$data->exists('data')) {
86
+			throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
87
+		}
88
+
89
+		$contacts = [];
90
+
91
+		foreach ($data->filter('data')->toArray() as $idx => $entry) {
92
+			$userContact = new User\Contact();
93
+
94
+			$userContact->identifier = $entry->get('id');
95
+			$userContact->displayName = $entry->get('name');
96
+			$userContact->email = $entry->filter('emails')->get('preferred');
97
+
98
+			$contacts[] = $userContact;
99
+		}
100
+
101
+		return $contacts;
102
+	}
103 103
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         $data = new Data\Collection($response);
53 53
 
54
-        if (!$data->exists('id')) {
54
+        if ( ! $data->exists('id')) {
55 55
             throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
56 56
         }
57 57
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         $data = new Data\Collection($response);
84 84
 
85
-        if (!$data->exists('data')) {
85
+        if ( ! $data->exists('data')) {
86 86
             throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
87 87
         }
88 88
 
Please login to merge, or discard this patch.
src/Provider/Disqus.php 2 patches
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -17,72 +17,72 @@
 block discarded – undo
17 17
  */
18 18
 class Disqus extends OAuth2
19 19
 {
20
-    /**
21
-     * {@inheritdoc}
22
-     */
23
-    protected $scope = 'read,email';
24
-
25
-    /**
26
-     * {@inheritdoc}
27
-     */
28
-    protected $apiBaseUrl = 'https://disqus.com/api/3.0/';
29
-
30
-    /**
31
-     * {@inheritdoc}
32
-     */
33
-    protected $authorizeUrl = 'https://disqus.com/api/oauth/2.0/authorize';
34
-
35
-    /**
36
-     * {@inheritdoc}
37
-     */
38
-    protected $accessTokenUrl = 'https://disqus.com/api/oauth/2.0/access_token/';
39
-
40
-    /**
41
-     * {@inheritdoc}
42
-     */
43
-    protected $apiDocumentation = 'https://disqus.com/api/docs/auth/';
44
-
45
-    /**
46
-     * {@inheritdoc}
47
-     */
48
-    protected function initialize()
49
-    {
50
-        parent::initialize();
51
-
52
-        $this->apiRequestParameters = [
53
-            'api_key' => $this->clientId, 'api_secret' => $this->clientSecret
54
-        ];
55
-    }
56
-
57
-    /**
58
-     * {@inheritdoc}
59
-     */
60
-    public function getUserProfile()
61
-    {
62
-        $response = $this->apiRequest('users/details');
63
-
64
-        $data = new Data\Collection($response);
65
-
66
-        if (!$data->filter('response')->exists('id')) {
67
-            throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
68
-        }
69
-
70
-        $userProfile = new User\Profile();
71
-
72
-        $data = $data->filter('response');
73
-
74
-        $userProfile->identifier = $data->get('id');
75
-        $userProfile->displayName = $data->get('name');
76
-        $userProfile->description = $data->get('bio');
77
-        $userProfile->profileURL = $data->get('profileUrl');
78
-        $userProfile->email = $data->get('email');
79
-        $userProfile->region = $data->get('location');
80
-        $userProfile->description = $data->get('about');
81
-
82
-        $userProfile->photoURL = $data->filter('avatar')->get('permalink');
83
-
84
-        $userProfile->displayName = $userProfile->displayName ?: $data->get('username');
85
-
86
-        return $userProfile;
87
-    }
20
+	/**
21
+	 * {@inheritdoc}
22
+	 */
23
+	protected $scope = 'read,email';
24
+
25
+	/**
26
+	 * {@inheritdoc}
27
+	 */
28
+	protected $apiBaseUrl = 'https://disqus.com/api/3.0/';
29
+
30
+	/**
31
+	 * {@inheritdoc}
32
+	 */
33
+	protected $authorizeUrl = 'https://disqus.com/api/oauth/2.0/authorize';
34
+
35
+	/**
36
+	 * {@inheritdoc}
37
+	 */
38
+	protected $accessTokenUrl = 'https://disqus.com/api/oauth/2.0/access_token/';
39
+
40
+	/**
41
+	 * {@inheritdoc}
42
+	 */
43
+	protected $apiDocumentation = 'https://disqus.com/api/docs/auth/';
44
+
45
+	/**
46
+	 * {@inheritdoc}
47
+	 */
48
+	protected function initialize()
49
+	{
50
+		parent::initialize();
51
+
52
+		$this->apiRequestParameters = [
53
+			'api_key' => $this->clientId, 'api_secret' => $this->clientSecret
54
+		];
55
+	}
56
+
57
+	/**
58
+	 * {@inheritdoc}
59
+	 */
60
+	public function getUserProfile()
61
+	{
62
+		$response = $this->apiRequest('users/details');
63
+
64
+		$data = new Data\Collection($response);
65
+
66
+		if (!$data->filter('response')->exists('id')) {
67
+			throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
68
+		}
69
+
70
+		$userProfile = new User\Profile();
71
+
72
+		$data = $data->filter('response');
73
+
74
+		$userProfile->identifier = $data->get('id');
75
+		$userProfile->displayName = $data->get('name');
76
+		$userProfile->description = $data->get('bio');
77
+		$userProfile->profileURL = $data->get('profileUrl');
78
+		$userProfile->email = $data->get('email');
79
+		$userProfile->region = $data->get('location');
80
+		$userProfile->description = $data->get('about');
81
+
82
+		$userProfile->photoURL = $data->filter('avatar')->get('permalink');
83
+
84
+		$userProfile->displayName = $userProfile->displayName ?: $data->get('username');
85
+
86
+		return $userProfile;
87
+	}
88 88
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 
64 64
         $data = new Data\Collection($response);
65 65
 
66
-        if (!$data->filter('response')->exists('id')) {
66
+        if ( ! $data->filter('response')->exists('id')) {
67 67
             throw new UnexpectedApiResponseException('Provider API returned an unexpected response.');
68 68
         }
69 69
 
Please login to merge, or discard this patch.
src/Provider/PaypalOpenID.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -15,57 +15,57 @@
 block discarded – undo
15 15
  */
16 16
 class PaypalOpenID extends OpenID
17 17
 {
18
-    /**
19
-     * {@inheritdoc}
20
-     */
21
-    protected $openidIdentifier = 'https://www.sandbox.paypal.com/webapps/auth/server';
18
+	/**
19
+	 * {@inheritdoc}
20
+	 */
21
+	protected $openidIdentifier = 'https://www.sandbox.paypal.com/webapps/auth/server';
22 22
 
23
-    /**
24
-     * {@inheritdoc}
25
-     */
26
-    protected $apiDocumentation = 'https://developer.paypal.com/docs/connect-with-paypal/';
23
+	/**
24
+	 * {@inheritdoc}
25
+	 */
26
+	protected $apiDocumentation = 'https://developer.paypal.com/docs/connect-with-paypal/';
27 27
 
28
-    /**
29
-     * {@inheritdoc}
30
-     */
31
-    public function authenticateBegin()
32
-    {
33
-        $this->openIdClient->identity = $this->openidIdentifier;
34
-        $this->openIdClient->returnUrl = $this->callback;
35
-        $this->openIdClient->required = [
36
-            'namePerson/prefix',
37
-            'namePerson/first',
38
-            'namePerson/last',
39
-            'namePerson/middle',
40
-            'namePerson/suffix',
41
-            'namePerson/friendly',
42
-            'person/guid',
43
-            'birthDate/birthYear',
44
-            'birthDate/birthMonth',
45
-            'birthDate/birthday',
46
-            'gender',
47
-            'language/pref',
48
-            'contact/phone/default',
49
-            'contact/phone/home',
50
-            'contact/phone/business',
51
-            'contact/phone/cell',
52
-            'contact/phone/fax',
53
-            'contact/postaladdress/home',
54
-            'contact/postaladdressadditional/home',
55
-            'contact/city/home',
56
-            'contact/state/home',
57
-            'contact/country/home',
58
-            'contact/postalcode/home',
59
-            'contact/postaladdress/business',
60
-            'contact/postaladdressadditional/business',
61
-            'contact/city/business',
62
-            'contact/state/business',
63
-            'contact/country/business',
64
-            'contact/postalcode/business',
65
-            'company/name',
66
-            'company/title',
67
-        ];
28
+	/**
29
+	 * {@inheritdoc}
30
+	 */
31
+	public function authenticateBegin()
32
+	{
33
+		$this->openIdClient->identity = $this->openidIdentifier;
34
+		$this->openIdClient->returnUrl = $this->callback;
35
+		$this->openIdClient->required = [
36
+			'namePerson/prefix',
37
+			'namePerson/first',
38
+			'namePerson/last',
39
+			'namePerson/middle',
40
+			'namePerson/suffix',
41
+			'namePerson/friendly',
42
+			'person/guid',
43
+			'birthDate/birthYear',
44
+			'birthDate/birthMonth',
45
+			'birthDate/birthday',
46
+			'gender',
47
+			'language/pref',
48
+			'contact/phone/default',
49
+			'contact/phone/home',
50
+			'contact/phone/business',
51
+			'contact/phone/cell',
52
+			'contact/phone/fax',
53
+			'contact/postaladdress/home',
54
+			'contact/postaladdressadditional/home',
55
+			'contact/city/home',
56
+			'contact/state/home',
57
+			'contact/country/home',
58
+			'contact/postalcode/home',
59
+			'contact/postaladdress/business',
60
+			'contact/postaladdressadditional/business',
61
+			'contact/city/business',
62
+			'contact/state/business',
63
+			'contact/country/business',
64
+			'contact/postalcode/business',
65
+			'company/name',
66
+			'company/title',
67
+		];
68 68
 
69
-        HttpClient\Util::redirect($this->openIdClient->authUrl());
70
-    }
69
+		HttpClient\Util::redirect($this->openIdClient->authUrl());
70
+	}
71 71
 }
Please login to merge, or discard this patch.