diff --git a/src/Config/WinterPrinter.php b/src/Config/WinterPrinter.php new file mode 100644 index 000000000..61a4ec7a3 --- /dev/null +++ b/src/Config/WinterPrinter.php @@ -0,0 +1,29 @@ +hasNodeWithComments($nodes) || (isset($nodes[0]) && $nodes[0] instanceof ArrayItem)) { + return $this->pCommaSeparatedMultiline($nodes, $trailingComma) . $this->nl; + } else { + return $this->pCommaSeparated($nodes); + } + } + + protected function pComments(array $comments): string + { + $formattedComments = []; + + foreach ($comments as $comment) { + $formattedComments[] = str_replace("\n", $this->nl, $comment->getReformattedText()); + } + + return $this->nl . implode($this->nl, $formattedComments) . $this->nl; + } +}