Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
42 | private function buildCountAssignment(Mailcode_Commands_Command_SetVariable $command) : ?string |
||
43 | { |
||
44 | $variable = $command->getCountVariable(); |
||
45 | |||
46 | if ($variable === null) { |
||
47 | return null; |
||
48 | } |
||
49 | |||
50 | if($variable->hasPath()) { |
||
51 | return sprintf( |
||
52 | '$map.of(%s).keys("%s").count()', |
||
53 | dollarize($variable->getPath()), |
||
54 | $variable->getName() |
||
55 | ); |
||
56 | } |
||
57 | |||
58 | return sprintf( |
||
59 | '$map.of(%s).count()', |
||
60 | dollarize($variable->getName()) |
||
61 | ); |
||
64 |