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