Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace nyx\auth\id\protocols\oauth2\providers; |
||
41 | protected function getDefaultRequestOptions(auth\interfaces\Token $token = null) : array |
||
42 | { |
||
43 | if (isset($token)) { |
||
44 | return parent::getDefaultRequestOptions($token); |
||
45 | } |
||
46 | |||
47 | // Slack expects the token to be present in each authorized request as the 'token' parameter. |
||
48 | // Note: Passing it in the body yielded 'not_authed' (ie. no token) errors from Slack. |
||
49 | return array_merge_recursive(parent::getDefaultRequestOptions(), [ |
||
50 | 'query' => [ |
||
51 | 'token' => $token->getId() |
||
|
|||
52 | ] |
||
53 | ]); |
||
54 | } |
||
55 | } |
||
56 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.