Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
34 | 1 | public function getShortLink($long_url) |
|
35 | { |
||
36 | 1 | $adapter = $this->getAdapter(); |
|
37 | $data = [ |
||
38 | 1 | 'long_url' => $long_url |
|
39 | ]; |
||
40 | 1 | $response = $adapter->post('shorten', $data); |
|
41 | 1 | $content = $response->getBody()->getContents(); |
|
42 | 1 | $array = json_decode($content, 1); |
|
43 | 1 | return $array['link']; |
|
44 | } |
||
62 |