1 | <?php |
||
15 | abstract class AbstractProvider extends AbstractBaseProvider |
||
16 | { |
||
17 | /** |
||
18 | * HTTP method for access token request |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $requestHttpMethod = Client::POST; |
||
23 | |||
24 | /** |
||
25 | * @return string |
||
26 | */ |
||
27 | abstract public function getAuthorizeUri(); |
||
28 | |||
29 | /** |
||
30 | * @return string |
||
31 | */ |
||
32 | abstract public function getRequestTokenUri(); |
||
33 | |||
34 | /** |
||
35 | * Default parameters for auth url, can be redeclared inside implementation of the Provider |
||
36 | * |
||
37 | * @return array |
||
38 | */ |
||
39 | 1 | public function getAuthUrlParameters() |
|
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | 1 | public function makeAuthUrl() |
|
69 | |||
70 | /** |
||
71 | * Parse access token from response's $body |
||
72 | * |
||
73 | * @param string|bool $body |
||
74 | * @return AccessToken |
||
75 | * @throws InvalidAccessToken |
||
76 | */ |
||
77 | public function parseToken($body) |
||
91 | |||
92 | /** |
||
93 | * @param string $code |
||
94 | * @return \SocialConnect\Common\Http\Request |
||
95 | */ |
||
96 | 2 | protected function makeAccessTokenRequest($code) |
|
115 | |||
116 | /** |
||
117 | * @param string $code |
||
118 | * @return AccessToken |
||
119 | * @throws InvalidResponse |
||
120 | */ |
||
121 | 2 | public function getAccessToken($code) |
|
141 | |||
142 | |||
143 | /** |
||
144 | * @param array $parameters |
||
145 | * @return AccessToken |
||
146 | */ |
||
147 | public function getAccessTokenByRequestParameters(array $parameters) |
||
151 | } |
||
152 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: