1 | <?php |
||
23 | class SinaWeibo extends AbstractProvider |
||
24 | { |
||
25 | |||
26 | |||
27 | /** |
||
28 | * Returns the base URL for authorizing a client. |
||
29 | * |
||
30 | * Eg. https://oauth.service.com/authorize |
||
31 | * |
||
32 | * @return string |
||
33 | */ |
||
34 | 6 | public function getBaseAuthorizationUrl() |
|
38 | |||
39 | /** |
||
40 | * Returns the base URL for requesting an access token. |
||
41 | * |
||
42 | * Eg. https://oauth.service.com/token |
||
43 | * |
||
44 | * @param array $params |
||
45 | * @return string |
||
46 | */ |
||
47 | 12 | public function getBaseAccessTokenUrl(array $params) |
|
58 | |||
59 | /** |
||
60 | * Returns the URL for requesting the resource owner's details. |
||
61 | * |
||
62 | * @param AccessToken $token |
||
63 | * @return string |
||
64 | */ |
||
65 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
69 | |||
70 | |||
71 | /** |
||
72 | * Returns the default scopes used by this provider. |
||
73 | * |
||
74 | * This should only be the scopes that are required to request the details |
||
75 | * of the resource owner, rather than all the available scopes. |
||
76 | * |
||
77 | * @return array |
||
78 | */ |
||
79 | 6 | protected function getDefaultScopes() |
|
83 | |||
84 | /** |
||
85 | * Checks a provider response for errors. |
||
86 | * @param ResponseInterface $response |
||
87 | * @param array|string $data |
||
88 | * @throws \League\OAuth2\Client\Provider\Exception\IdentityProviderException |
||
89 | */ |
||
90 | 9 | protected function checkResponse(ResponseInterface $response, $data) |
|
98 | |||
99 | /** |
||
100 | * Generates a resource owner object from a successful resource owner |
||
101 | * details request. |
||
102 | * |
||
103 | * @param array $response |
||
104 | * @param AccessToken $token |
||
105 | * @return \League\OAuth2\Client\Provider\ResourceOwnerInterface |
||
106 | */ |
||
107 | protected function createResourceOwner(array $response, AccessToken $token) |
||
111 | } |
||
112 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.