Conditions | 6 |
Paths | 5 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
34 | 2 | public function enterNode(Node $node): ?Node |
|
35 | { |
||
36 | 2 | if (!$node instanceof Node\Expr\MethodCall) { |
|
37 | 2 | return null; |
|
38 | } |
||
39 | |||
40 | 2 | if (!\is_string($node->name) && !$node->name instanceof Node\Identifier) { |
|
41 | 1 | return null; |
|
42 | } |
||
43 | 2 | $name = (string) $node->name; |
|
44 | |||
45 | //If $this->get('translator')->transChoice('foobar') |
||
46 | 2 | if ('transChoice' === $name) { |
|
47 | 2 | $label = $this->getStringArgument($node, 0); |
|
48 | 2 | if (null === $label) { |
|
49 | 2 | return null; |
|
50 | } |
||
51 | 2 | $domain = $this->getStringArgument($node, 3); |
|
52 | |||
53 | 2 | $this->addLocation($label, $node->getAttribute('startLine'), $node, ['domain' => $domain]); |
|
54 | } |
||
55 | |||
56 | 2 | return null; |
|
57 | } |
||
58 | |||
75 |