Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
30 | 3 | public function work($node, SourceCollection $collection, callable $getAbsoluteFilePath) |
|
31 | { |
||
32 | 3 | if ($node instanceof TransNode) { |
|
33 | 3 | $id = $node->getNode('body')->getAttribute('data'); |
|
34 | 3 | $domain = 'messages'; |
|
35 | 3 | if ($node->hasNode('domain')) { |
|
36 | 2 | if (null !== $domainNode = $node->getNode('domain')) { |
|
37 | 2 | $domain = $domainNode->getAttribute('value'); |
|
38 | 2 | } |
|
39 | 2 | } |
|
40 | |||
41 | 3 | $source = new SourceLocation($id, $getAbsoluteFilePath(), $node->getTemplateLine(), ['domain' => $domain]); |
|
42 | 3 | $collection->addLocation($source); |
|
43 | 3 | } |
|
44 | |||
45 | 3 | return $node; |
|
46 | } |
||
47 | } |
||
48 |