| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | private function buildCountAssignment(Mailcode_Commands_Command_SetVariable $command) : ?string |
||
| 51 | { |
||
| 52 | $variable = $command->getCountVariable(); |
||
| 53 | |||
| 54 | if ($variable === null) { |
||
| 55 | return null; |
||
| 56 | } |
||
| 57 | |||
| 58 | if($variable->hasPath()) { |
||
| 59 | return sprintf( |
||
| 60 | '$map.of(%s).keys("%s").count()', |
||
| 61 | dollarize($variable->getPath()), |
||
| 62 | $variable->getName() |
||
| 63 | ); |
||
| 64 | } |
||
| 65 | |||
| 66 | return sprintf( |
||
| 67 | '$map.of(%s).count()', |
||
| 68 | dollarize($variable->getName()) |
||
| 69 | ); |
||
| 72 |