Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
49 | 12 | private function getLinks($response) { |
|
50 | 12 | $link_header = $response->getHeader('Link'); |
|
51 | 12 | if ($link_header == null) { |
|
52 | 10 | return []; |
|
53 | } |
||
54 | 2 | $links = []; |
|
55 | 2 | foreach (explode(', ', $link_header) as $link) { |
|
56 | 2 | preg_match('/rel=\"(.*)\"/', $link, $matches); |
|
57 | 2 | $key = $matches[1]; |
|
58 | 2 | preg_match('/\<(.*)\>/', $link, $matches); |
|
59 | 2 | $value = $matches[1]; |
|
60 | 2 | $links[$key] = $value; |
|
61 | 2 | } |
|
62 | 2 | return $links; |
|
63 | } |
||
64 | } |