Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 19a8b3e

Browse files
committed
Don't show prefix and postfix if there is no placeholder items.
1 parent 4d9954c commit 19a8b3e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Helper/Placeholder/Container/AbstractContainer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ public function toString($indent = null)
118118
: $this->getIndent();
119119

120120
$items = $this->getArrayCopy();
121+
// If we don't have items - do not show prefix and postfix
122+
if (!count($items)) {
123+
return '';
124+
}
121125
$return = $indent
122126
. $this->getPrefix()
123127
. implode($this->getSeparator(), $items)

0 commit comments

Comments
 (0)