1 | <?php |
||
6 | class TwitterService |
||
|
|||
7 | { |
||
8 | /** |
||
9 | * @config |
||
10 | * |
||
11 | * @var string |
||
12 | */ |
||
13 | private static $consumer_key; |
||
14 | |||
15 | /** |
||
16 | * @config |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | private static $consumer_secret; |
||
21 | |||
22 | /** |
||
23 | * @config |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | private static $oauth_callback; |
||
28 | |||
29 | /** |
||
30 | * Create a Twitter API interface. |
||
31 | * |
||
32 | * @param string $token |
||
33 | * |
||
34 | * @param string $secret |
||
35 | * |
||
36 | * @return Abraham\TwitterOAuth\TwitterOAuth |
||
37 | */ |
||
38 | public function getClient($token = null, $secret = null) |
||
59 | |||
60 | /** |
||
61 | * Gets the OAuth callback URL. |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | public function getOAuthCallback() |
||
78 | |||
79 | /** |
||
80 | * Gets a temporary request token to kick off the OAuth flow. |
||
81 | * |
||
82 | * @return array |
||
83 | */ |
||
84 | public function getOAuthToken() |
||
104 | |||
105 | /** |
||
106 | * Gets the login URL for users to authenticate with. |
||
107 | * |
||
108 | * @param array $token |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | public function getAuthoriseUrl($token) |
||
123 | |||
124 | /** |
||
125 | * Sets the temporary request token in session. |
||
126 | * |
||
127 | * @param array $token |
||
128 | */ |
||
129 | public function setSessionOAuthToken($token) |
||
139 | |||
140 | /** |
||
141 | * Gets the temporary request token from session. |
||
142 | * |
||
143 | * @return array |
||
144 | */ |
||
145 | public function getSessionOAuthToken() { |
||
148 | |||
149 | /** |
||
150 | * Clears the temporary token from session. |
||
151 | */ |
||
152 | public function clearSessionOAuthToken() |
||
156 | |||
157 | /** |
||
158 | * Gets an access token used for making authenticated requests to the Twitter API. |
||
159 | * |
||
160 | * @param string $token |
||
161 | * |
||
162 | * @param string $secret |
||
163 | * |
||
164 | * @param string $verifier |
||
165 | * |
||
166 | * @return array|null |
||
167 | */ |
||
168 | public function getAccessToken($token, $secret, $verifier) |
||
182 | } |
||
183 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.