@@ -32,7 +32,9 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | private const IF = "if"; |
| 34 | 34 | private const ELSE_IF = "elseif"; |
| 35 | - private const ELSE = "else"; |
|
| 35 | + private const ELSE { |
|
| 36 | + = "else"; |
|
| 37 | + } |
|
| 36 | 38 | |
| 37 | 39 | private MapInterface $children; |
| 38 | 40 | |
@@ -60,7 +62,9 @@ discard block |
||
| 60 | 62 | $elseIf->add(new ChooseElseIf($child, $this)); |
| 61 | 63 | break; |
| 62 | 64 | case 'else': |
| 63 | - $this->children->put(self::ELSE, new ChooseElse($child, $this)); |
|
| 65 | + $this->children->put(self::ELSE { |
|
| 66 | + , new ChooseElse($child, $this)); |
|
| 67 | + } |
|
| 64 | 68 | break; |
| 65 | 69 | } |
| 66 | 70 | } |
@@ -101,9 +105,11 @@ discard block |
||
| 101 | 105 | } |
| 102 | 106 | |
| 103 | 107 | // !$matchedIfs ensures that each previous condition has not been met |
| 104 | - if (!$matchedIfs && $this->children->containsKey(self::ELSE)) { //ELSE |
|
| 108 | + if (!$matchedIfs && $this->children->containsKey(self::ELSE { |
|
| 109 | + )) { //ELSE |
|
| 105 | 110 | $result->add($this->children->get(self::ELSE)->render($data)); |
| 106 | 111 | } |
| 112 | + } |
|
| 107 | 113 | return $result->joinToString(""); |
| 108 | 114 | } |
| 109 | 115 | |