1 | <?php |
||
16 | class PinterestOAuth { |
||
17 | |||
18 | /** |
||
19 | * The application ID |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | private $client_id; |
||
24 | |||
25 | /** |
||
26 | * The app secret |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | private $client_secret; |
||
31 | |||
32 | /** |
||
33 | * Random string indicating the state |
||
34 | * to prevent spoofing |
||
35 | * |
||
36 | * @var void |
||
37 | */ |
||
38 | private $state; |
||
39 | |||
40 | /** |
||
41 | * A reference to the request instance |
||
42 | * |
||
43 | * @var Request |
||
44 | */ |
||
45 | private $request; |
||
46 | |||
47 | /** |
||
48 | * Pinterest's oauth endpoint |
||
49 | */ |
||
50 | const AUTH_HOST = "https://api.pinterest.com/oauth/"; |
||
51 | |||
52 | /** |
||
53 | * Construct |
||
54 | * |
||
55 | * @param string $client_id |
||
56 | * @param string $client_secret |
||
57 | * @param Request $request |
||
58 | */ |
||
59 | 43 | public function __construct($client_id, $client_secret, $request) |
|
70 | |||
71 | /** |
||
72 | * Returns the login url |
||
73 | * |
||
74 | * @access public |
||
75 | * @param array $scopes |
||
76 | * @param string $redirect_uri |
||
77 | * @return string |
||
78 | */ |
||
79 | public function getLoginUrl($redirect_uri, $scopes = array("read_public"), $response_type = "code") |
||
92 | |||
93 | /** |
||
94 | * Generates a random string and returns is |
||
95 | * |
||
96 | * @access private |
||
97 | * @return string random string |
||
98 | */ |
||
99 | 43 | private function generateState() |
|
103 | |||
104 | /** |
||
105 | * Get the generated state |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | 2 | public function getState() |
|
113 | |||
114 | /** |
||
115 | * Set a state manually |
||
116 | * |
||
117 | * @param string $state |
||
118 | * @return void |
||
119 | */ |
||
120 | 1 | public function setState($state) |
|
124 | |||
125 | /** |
||
126 | * Change the code for an access_token |
||
127 | * |
||
128 | * @param string $code |
||
129 | * @return \DirkGroenen\Pinterest\Transport\Response |
||
130 | */ |
||
131 | public function getOAuthToken($code) |
||
146 | |||
147 | /** |
||
148 | * Set the access_token for further requests |
||
149 | * |
||
150 | * @access public |
||
151 | * @param string $access_token |
||
152 | * @return void |
||
153 | */ |
||
154 | 43 | public function setOAuthToken($access_token) |
|
158 | } |
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..