Skip to content

Commit

Permalink
Upgrade some PrettyPrinter methods to protected
Browse files Browse the repository at this point in the history
I noticed some methods in the Standard PrettyPrinter is private, can they be upgraded to `protected` to ease when extending it?
  • Loading branch information
ajthinking authored and nikic committed Oct 17, 2020
1 parent d520bc9 commit 1d1bc8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/PhpParser/PrettyPrinter/Standard.php
Expand Up @@ -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;
Expand All @@ -1049,15 +1049,15 @@ 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 {
return $this->pCommaSeparatedMultiline($nodes, $trailingComma) . $this->nl;
}
}

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) {
Expand Down

0 comments on commit 1d1bc8a

Please sign in to comment.