We have detected an error in your notification set-up
(Event-ID dab39dc24f564ec7bd4628d1305fd03c).
Currently, we cannot inform you about inspection progress.
Please check that the user
557058:bca11929-8c2d-43f2-8a82-c5416880d395 still has access to your repository or
update the API account.
| 1 | <?php |
||
| 24 | class OAuthPlugin implements Plugin |
||
| 25 | { |
||
| 26 | const ENDPOINT_REQUEST_TOKEN = 'oauth/request_token'; |
||
| 27 | const ENDPOINT_ACCESS_TOKEN = 'oauth/access_token'; |
||
| 28 | const ENDPOINT_AUTHORIZE = 'oauth/authenticate'; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var array |
||
| 32 | */ |
||
| 33 | protected $config = array( |
||
| 34 | 'oauth_consumer_key' => 'anon', |
||
| 35 | 'oauth_consumer_secret' => 'anon', |
||
| 36 | 'oauth_token' => '', |
||
| 37 | 'oauth_token_secret' => '', |
||
| 38 | 'oauth_signature_method' => 'HMAC-SHA1', |
||
| 39 | 'oauth_callback' => '', |
||
| 40 | 'oauth_verifier' => '', |
||
| 41 | 'oauth_version' => '1.0', |
||
| 42 | ); |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @var SignatureMethodInterface |
||
| 46 | */ |
||
| 47 | protected $signature; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @var TokenInterface |
||
| 51 | */ |
||
| 52 | protected $token; |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @var ConsumerInterface |
||
| 56 | */ |
||
| 57 | protected $consumer; |
||
| 58 | |||
| 59 | public function __construct( |
||
| 70 | |||
| 71 | public function handleRequest(\Psr\Http\Message\RequestInterface $request, callable $next, callable $first) |
||
| 87 | |||
| 88 | /** |
||
| 89 | * Include OAuth and request body parameters |
||
| 90 | * |
||
| 91 | * @access protected |
||
| 92 | * @param RequestInterface $request |
||
| 93 | * @return array |
||
| 94 | * |
||
| 95 | * @see http://oauth.net/core/1.0/#sig_norm_param |
||
| 96 | */ |
||
| 97 | protected function getParametersToSign(RequestInterface $request) |
||
| 107 | |||
| 108 | /** |
||
| 109 | * Include/exclude optional parameters |
||
| 110 | * |
||
| 111 | * The exclusion/inclusion is based on current request resource |
||
| 112 | * |
||
| 113 | * @access protected |
||
| 114 | * @param RequestInterface $request |
||
| 115 | * @return array |
||
| 116 | */ |
||
| 117 | protected function getOAuthParameters(RequestInterface $request) |
||
| 129 | |||
| 130 | /** |
||
| 131 | * White list based filter |
||
| 132 | * |
||
| 133 | * @access protected |
||
| 134 | * @param string[] $include |
||
| 135 | * @return array |
||
| 136 | */ |
||
| 137 | protected function filterOAuthParameters(array $include) |
||
| 149 | |||
| 150 | /** |
||
| 151 | * Transform request content to associative array |
||
| 152 | * |
||
| 153 | * @access protected |
||
| 154 | * @param RequestInterface $request |
||
| 155 | * @return array |
||
| 156 | */ |
||
| 157 | protected function getContentAsParameters(RequestInterface $request) |
||
| 163 | |||
| 164 | /** |
||
| 165 | * Check if specified endpoint is in current request |
||
| 166 | * |
||
| 167 | * @param string $endpoint |
||
| 168 | * @param RequestInterface $request |
||
| 169 | * @return bool |
||
| 170 | */ |
||
| 171 | protected function isEndpointRequested($endpoint, RequestInterface $request) |
||
| 175 | |||
| 176 | /** |
||
| 177 | * Bitbucket supports only HMAC-SHA1 and PlainText signatures. |
||
| 178 | * |
||
| 179 | * For better security, HMAC-SHA1 is the default one. |
||
| 180 | * |
||
| 181 | * @return \JacobKiers\OAuth\SignatureMethod\SignatureMethodInterface |
||
| 182 | */ |
||
| 183 | protected function getSigner() |
||
| 195 | |||
| 196 | /** |
||
| 197 | * @access public |
||
| 198 | * @param TokenInterface|null $token |
||
| 199 | * @return TokenInterface |
||
| 200 | */ |
||
| 201 | protected function initToken($token) |
||
| 210 | |||
| 211 | /** |
||
| 212 | * @access public |
||
| 213 | * @param ConsumerInterface|null $consumer |
||
| 214 | * @return ConsumerInterface |
||
| 215 | */ |
||
| 216 | protected function initConsumer($consumer) |
||
| 226 | } |
||
| 227 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: