Skip to content

Commit 1d1bc8a

Browse files
ajthinkingnikic
authored andcommitted
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?
1 parent d520bc9 commit 1d1bc8a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/PhpParser/PrettyPrinter/Standard.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ protected function pNewVariable(Node $node) {
10401040
* @param Node[] $nodes
10411041
* @return bool
10421042
*/
1043-
private function hasNodeWithComments(array $nodes) {
1043+
protected function hasNodeWithComments(array $nodes) {
10441044
foreach ($nodes as $node) {
10451045
if ($node && $node->getComments()) {
10461046
return true;
@@ -1049,15 +1049,15 @@ private function hasNodeWithComments(array $nodes) {
10491049
return false;
10501050
}
10511051

1052-
private function pMaybeMultiline(array $nodes, bool $trailingComma = false) {
1052+
protected function pMaybeMultiline(array $nodes, bool $trailingComma = false) {
10531053
if (!$this->hasNodeWithComments($nodes)) {
10541054
return $this->pCommaSeparated($nodes);
10551055
} else {
10561056
return $this->pCommaSeparatedMultiline($nodes, $trailingComma) . $this->nl;
10571057
}
10581058
}
10591059

1060-
private function pAttrGroups(array $nodes, bool $inline = false): string {
1060+
protected function pAttrGroups(array $nodes, bool $inline = false): string {
10611061
$result = '';
10621062
$sep = $inline ? ' ' : $this->nl;
10631063
foreach ($nodes as $node) {

0 commit comments

Comments
 (0)