@@ -17,80 +17,80 @@ |
||
17 | 17 | */ |
18 | 18 | class AutoDesk extends OAuth2 |
19 | 19 | { |
20 | - /** |
|
21 | - * {@inheritdoc} |
|
22 | - */ |
|
23 | - protected $scope = 'data:read'; |
|
20 | + /** |
|
21 | + * {@inheritdoc} |
|
22 | + */ |
|
23 | + protected $scope = 'data:read'; |
|
24 | 24 | |
25 | - /** |
|
26 | - * {@inheritdoc} |
|
27 | - */ |
|
28 | - protected $apiBaseUrl = 'https://developer.api.autodesk.com/'; |
|
25 | + /** |
|
26 | + * {@inheritdoc} |
|
27 | + */ |
|
28 | + protected $apiBaseUrl = 'https://developer.api.autodesk.com/'; |
|
29 | 29 | |
30 | - /** |
|
31 | - * {@inheritdoc} |
|
32 | - */ |
|
33 | - protected $authorizeUrl |
|
34 | - = 'https://developer.api.autodesk.com/authentication/v1/authorize'; |
|
30 | + /** |
|
31 | + * {@inheritdoc} |
|
32 | + */ |
|
33 | + protected $authorizeUrl |
|
34 | + = 'https://developer.api.autodesk.com/authentication/v1/authorize'; |
|
35 | 35 | |
36 | - /** |
|
37 | - * {@inheritdoc} |
|
38 | - */ |
|
39 | - protected $accessTokenUrl |
|
40 | - = 'https://developer.api.autodesk.com/authentication/v1/gettoken'; |
|
36 | + /** |
|
37 | + * {@inheritdoc} |
|
38 | + */ |
|
39 | + protected $accessTokenUrl |
|
40 | + = 'https://developer.api.autodesk.com/authentication/v1/gettoken'; |
|
41 | 41 | |
42 | - /** |
|
43 | - * {@inheritdoc} |
|
44 | - */ |
|
45 | - protected $refreshTokenUrl |
|
46 | - = 'https://developer.api.autodesk.com/authentication/v1/refreshtoken'; |
|
42 | + /** |
|
43 | + * {@inheritdoc} |
|
44 | + */ |
|
45 | + protected $refreshTokenUrl |
|
46 | + = 'https://developer.api.autodesk.com/authentication/v1/refreshtoken'; |
|
47 | 47 | |
48 | - /** |
|
49 | - * {@inheritdoc} |
|
50 | - */ |
|
51 | - protected $apiDocumentation |
|
52 | - = 'https://forge.autodesk.com/en/docs/oauth/v2/developers_guide/overview/'; |
|
48 | + /** |
|
49 | + * {@inheritdoc} |
|
50 | + */ |
|
51 | + protected $apiDocumentation |
|
52 | + = 'https://forge.autodesk.com/en/docs/oauth/v2/developers_guide/overview/'; |
|
53 | 53 | |
54 | - /** |
|
55 | - * {@inheritdoc} |
|
56 | - */ |
|
57 | - protected function initialize() |
|
58 | - { |
|
59 | - parent::initialize(); |
|
54 | + /** |
|
55 | + * {@inheritdoc} |
|
56 | + */ |
|
57 | + protected function initialize() |
|
58 | + { |
|
59 | + parent::initialize(); |
|
60 | 60 | |
61 | - if ($this->isRefreshTokenAvailable()) { |
|
62 | - $this->tokenRefreshParameters += [ |
|
63 | - 'client_id' => $this->clientId, |
|
64 | - 'client_secret' => $this->clientSecret, |
|
65 | - 'grant_type' => 'refresh_token', |
|
66 | - ]; |
|
67 | - } |
|
68 | - } |
|
61 | + if ($this->isRefreshTokenAvailable()) { |
|
62 | + $this->tokenRefreshParameters += [ |
|
63 | + 'client_id' => $this->clientId, |
|
64 | + 'client_secret' => $this->clientSecret, |
|
65 | + 'grant_type' => 'refresh_token', |
|
66 | + ]; |
|
67 | + } |
|
68 | + } |
|
69 | 69 | |
70 | - /** |
|
71 | - * {@inheritdoc} |
|
72 | - * |
|
73 | - * See: https://forge.autodesk.com/en/docs/oauth/v2/reference/http/users-@me-GET/ |
|
74 | - */ |
|
75 | - public function getUserProfile() |
|
76 | - { |
|
77 | - $response = $this->apiRequest('userprofile/v1/users/@me'); |
|
70 | + /** |
|
71 | + * {@inheritdoc} |
|
72 | + * |
|
73 | + * See: https://forge.autodesk.com/en/docs/oauth/v2/reference/http/users-@me-GET/ |
|
74 | + */ |
|
75 | + public function getUserProfile() |
|
76 | + { |
|
77 | + $response = $this->apiRequest('userprofile/v1/users/@me'); |
|
78 | 78 | |
79 | - $collection = new Data\Collection($response); |
|
79 | + $collection = new Data\Collection($response); |
|
80 | 80 | |
81 | - $userProfile = new User\Profile(); |
|
81 | + $userProfile = new User\Profile(); |
|
82 | 82 | |
83 | - $userProfile->identifier = $collection->get('userId'); |
|
84 | - $userProfile->displayName |
|
85 | - = $collection->get('firstName') .' '. $collection->get('lastName'); |
|
86 | - $userProfile->firstName = $collection->get('firstName'); |
|
87 | - $userProfile->lastName = $collection->get('lastName'); |
|
88 | - $userProfile->email = $collection->get('emailId'); |
|
89 | - $userProfile->language = $collection->get('language'); |
|
90 | - $userProfile->webSiteURL = $collection->get('websiteUrl'); |
|
91 | - $userProfile->photoURL |
|
92 | - = $collection->filter('profileImages')->get('sizeX360'); |
|
83 | + $userProfile->identifier = $collection->get('userId'); |
|
84 | + $userProfile->displayName |
|
85 | + = $collection->get('firstName') .' '. $collection->get('lastName'); |
|
86 | + $userProfile->firstName = $collection->get('firstName'); |
|
87 | + $userProfile->lastName = $collection->get('lastName'); |
|
88 | + $userProfile->email = $collection->get('emailId'); |
|
89 | + $userProfile->language = $collection->get('language'); |
|
90 | + $userProfile->webSiteURL = $collection->get('websiteUrl'); |
|
91 | + $userProfile->photoURL |
|
92 | + = $collection->filter('profileImages')->get('sizeX360'); |
|
93 | 93 | |
94 | - return $userProfile; |
|
95 | - } |
|
94 | + return $userProfile; |
|
95 | + } |
|
96 | 96 | } |
@@ -82,7 +82,7 @@ |
||
82 | 82 | |
83 | 83 | $userProfile->identifier = $collection->get('userId'); |
84 | 84 | $userProfile->displayName |
85 | - = $collection->get('firstName') .' '. $collection->get('lastName'); |
|
85 | + = $collection->get('firstName').' '.$collection->get('lastName'); |
|
86 | 86 | $userProfile->firstName = $collection->get('firstName'); |
87 | 87 | $userProfile->lastName = $collection->get('lastName'); |
88 | 88 | $userProfile->email = $collection->get('emailId'); |