1 | <?php |
||
2 | /** |
||
3 | * SocialConnect project |
||
4 | * @author: Patsura Dmitry https://github.com/ovr <[email protected]> |
||
5 | */ |
||
6 | declare(strict_types=1); |
||
7 | |||
8 | namespace SocialConnect\OAuth1\Provider; |
||
9 | |||
10 | use SocialConnect\Common\ArrayHydrator; |
||
11 | use SocialConnect\Provider\AccessTokenInterface; |
||
12 | use SocialConnect\OAuth1\AbstractProvider; |
||
13 | use SocialConnect\Common\Entity\User; |
||
14 | |||
15 | class Trello extends AbstractProvider |
||
16 | { |
||
17 | const NAME = 'trello'; |
||
18 | |||
19 | /** |
||
20 | * {@inheritdoc} |
||
21 | */ |
||
22 | 2 | public function getBaseUri() |
|
23 | { |
||
24 | 2 | return 'https://api.trello.com/1/'; |
|
25 | } |
||
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | 1 | public function getAuthorizeUri() |
|
31 | { |
||
32 | 1 | return 'https://trello.com/1/OAuthAuthorizeToken'; |
|
33 | } |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | 1 | public function getRequestTokenUri() |
|
39 | { |
||
40 | 1 | return 'https://trello.com/1/OAuthGetRequestToken'; |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return string |
||
45 | */ |
||
46 | 1 | public function getRequestTokenAccessUri() |
|
47 | { |
||
48 | 1 | return 'https://trello.com/1/OAuthGetAccessToken'; |
|
49 | } |
||
50 | |||
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | 1 | public function getName() |
|
56 | { |
||
57 | 1 | return self::NAME; |
|
58 | } |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | 1 | public function getIdentity(AccessTokenInterface $accessToken) |
|
64 | { |
||
65 | 1 | $this->consumerToken = $accessToken; |
|
0 ignored issues
–
show
|
|||
66 | |||
67 | $parameters = [ |
||
68 | 1 | 'key' => $this->consumer->getKey(), |
|
69 | 1 | 'token' => $accessToken->getToken() |
|
70 | ]; |
||
71 | |||
72 | 1 | $result = $this->request( |
|
73 | 1 | 'GET', |
|
74 | 1 | 'members/me', |
|
75 | $parameters |
||
76 | ); |
||
77 | |||
78 | 1 | $hydrator = new ArrayHydrator([ |
|
79 | 1 | 'avatarUrl' => 'pictureURL', |
|
80 | 'fullName' => 'fullname', |
||
81 | ]); |
||
82 | |||
83 | 1 | return $hydrator->hydrate(new User(), $result); |
|
84 | } |
||
85 | } |
||
86 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..