Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
18 | 1 | private static function extractAttributes($line) |
|
19 | { |
||
20 | 1 | $attrsText = self::extractValue($line); |
|
21 | |||
22 | 1 | preg_match_all('/(?<=^|,)[A-Z0-9-]+=("?).+?\1(?=,|$)/', $attrsText, $matches); |
|
23 | 1 | $attributes = []; |
|
24 | 1 | foreach ($matches[0] as $attr) { |
|
25 | 1 | list($key, $value) = explode('=', $attr); |
|
26 | 1 | $attributes[$key] = trim($value); |
|
27 | 1 | } |
|
28 | |||
29 | 1 | return $attributes; |
|
30 | } |
||
31 | } |
||
32 |