From 1d1bc8a36459d67acef508b952dad097960b110e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20J=C3=BCrisoo?= Date: Sat, 10 Oct 2020 17:41:52 +0200 Subject: [PATCH] Upgrade some PrettyPrinter methods to protected I noticed some methods in the Standard PrettyPrinter is private, can they be upgraded to `protected` to ease when extending it? --- lib/PhpParser/PrettyPrinter/Standard.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PhpParser/PrettyPrinter/Standard.php b/lib/PhpParser/PrettyPrinter/Standard.php index c44bda9833..636129d553 100644 --- a/lib/PhpParser/PrettyPrinter/Standard.php +++ b/lib/PhpParser/PrettyPrinter/Standard.php @@ -1040,7 +1040,7 @@ protected function pNewVariable(Node $node) { * @param Node[] $nodes * @return bool */ - private function hasNodeWithComments(array $nodes) { + protected function hasNodeWithComments(array $nodes) { foreach ($nodes as $node) { if ($node && $node->getComments()) { return true; @@ -1049,7 +1049,7 @@ private function hasNodeWithComments(array $nodes) { return false; } - private function pMaybeMultiline(array $nodes, bool $trailingComma = false) { + protected function pMaybeMultiline(array $nodes, bool $trailingComma = false) { if (!$this->hasNodeWithComments($nodes)) { return $this->pCommaSeparated($nodes); } else { @@ -1057,7 +1057,7 @@ private function pMaybeMultiline(array $nodes, bool $trailingComma = false) { } } - private function pAttrGroups(array $nodes, bool $inline = false): string { + protected function pAttrGroups(array $nodes, bool $inline = false): string { $result = ''; $sep = $inline ? ' ' : $this->nl; foreach ($nodes as $node) {