| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function obtainRequestToken(string $redirectUrl, string $state = null) |
||
| 40 | { |
||
| 41 | $data = ['consumer_key' => $this->pocket->getConsumerKey(), 'redirect_uri' => $redirectUrl]; |
||
| 42 | if (!is_null($state)) { |
||
| 43 | $data = $data + ['state' => $state]; |
||
| 44 | } |
||
| 45 | |||
| 46 | $response = $this->request('/v3/oauth/request', $data); |
||
| 47 | $responseData = json_decode($response->getBody()); |
||
| 48 | |||
| 49 | return $responseData; |
||
| 50 | } |
||
| 51 | |||
| 65 |