1 | <?php |
||
15 | class Twitter extends AbstractService |
||
16 | { |
||
17 | const ENDPOINT_AUTHENTICATE = "https://api.twitter.com/oauth/authenticate"; |
||
18 | const ENDPOINT_AUTHORIZE = "https://api.twitter.com/oauth/authorize"; |
||
19 | |||
20 | protected $authorizationEndpoint = self::ENDPOINT_AUTHENTICATE; |
||
21 | |||
22 | public function __construct( |
||
23 | CredentialsInterface $credentials, |
||
24 | ClientInterface $httpClient, |
||
25 | TokenStorageInterface $storage, |
||
26 | SignatureInterface $signature, |
||
27 | UriInterface $baseApiUri = null |
||
28 | ) { |
||
29 | parent::__construct($credentials, $httpClient, $storage, $signature, $baseApiUri); |
||
30 | |||
31 | if (null === $baseApiUri) { |
||
32 | $this->baseApiUri = new Uri('https://api.twitter.com/1.1/'); |
||
33 | } |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | public function getRequestTokenEndpoint() |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | public function getAuthorizationEndpoint() |
||
48 | { |
||
49 | if ($this->authorizationEndpoint != self::ENDPOINT_AUTHENTICATE |
||
50 | && $this->authorizationEndpoint != self::ENDPOINT_AUTHORIZE) { |
||
51 | $this->authorizationEndpoint = self::ENDPOINT_AUTHENTICATE; |
||
52 | } |
||
53 | return new Uri($this->authorizationEndpoint); |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @param string $authorizationEndpoint |
||
|
|||
58 | * |
||
59 | * @throws Exception |
||
60 | */ |
||
61 | public function setAuthorizationEndpoint($endpoint) |
||
62 | { |
||
63 | if ($endpoint != self::ENDPOINT_AUTHENTICATE && $endpoint != self::ENDPOINT_AUTHORIZE) { |
||
64 | throw new Exception( |
||
65 | sprintf("'%s' is not a correct Twitter authorization endpoint.", $endpoint) |
||
66 | ); |
||
67 | } |
||
68 | $this->authorizationEndpoint = $endpoint; |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function getAccessTokenEndpoint() |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | protected function parseRequestTokenResponse($responseBody) |
||
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | protected function parseAccessTokenResponse($responseBody) |
||
123 | } |
||
124 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.