Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function convert($source) |
||
29 | { |
||
30 | $xpath = new DOMXPath($source); |
||
31 | $rewrites = []; |
||
32 | /** @var $rewriteNode DOMNode */ |
||
33 | foreach ($xpath->query('/config/rewrites/rewrite') as $rewriteNode) { |
||
34 | $rewriteAttributes = $rewriteNode->attributes; |
||
35 | $pathAttribute = $rewriteAttributes->getNamedItem('path'); |
||
36 | $targetAttribute = $rewriteAttributes->getNamedItem('target'); |
||
37 | $rewrites[$pathAttribute->nodeValue] = $targetAttribute->nodeValue; |
||
38 | } |
||
39 | return $rewrites; |
||
40 | } |
||
41 | } |
||
42 |