| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function prepareAuthorizationRequest( |
||
| 35 | RequestInterface $request |
||
| 36 | ): RequestInterface { |
||
| 37 | |||
| 38 | // Requested URI |
||
| 39 | $uri = $request->getUri(); |
||
| 40 | |||
| 41 | // Get Query |
||
| 42 | $query = $uri->getQuery(); |
||
| 43 | |||
| 44 | // Append to? |
||
| 45 | if (!empty($query)) { |
||
| 46 | $query .= '&'; |
||
| 47 | } |
||
| 48 | |||
| 49 | // Add our key |
||
| 50 | $query .= http_build_query([ |
||
| 51 | 'hapikey' => $this->key |
||
| 52 | ]); |
||
| 53 | |||
| 54 | return $request->withUri( |
||
| 55 | $uri->withQuery($query) |
||
| 56 | ); |
||
| 57 | } |
||
| 58 | |||
| 72 |