Skip to content

Commit

Permalink
Renames.
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru committed Oct 31, 2021
1 parent 88c854a commit 13a189e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Utils/SchemaPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ protected static function printArgs(array $options, array $args, string $indenta
}

// Return
return static::printLines($arguments, '(', ')', $description || static::isLineTooLong($length), $indentation);
return static::printChildrenBlock($arguments, '(', ')', $description || static::isLineTooLong($length), $indentation);
}

/**
Expand Down Expand Up @@ -448,7 +448,7 @@ protected static function printUnion(UnionType $type, array $options): string
: '';
$directives = static::printTypeDirectives($type, $options, '');

if (mb_strlen($directives) > static::LINE_LENGTH) {
if (static::isLineTooLong($directives)) {
$types = ltrim($types);
$directives .= "\n";
}
Expand Down Expand Up @@ -530,7 +530,8 @@ protected static function printInputObjectField(InputObjectField $type, array $o
*/
protected static function printBlock(array $items): string
{
return static::printLines($items, ' {', '}', true);
// TODO Deprecated?
return static::printChildrenBlock($items, ' {', '}', true);
}

/**
Expand Down Expand Up @@ -612,7 +613,7 @@ protected static function printTypeDirective(DirectiveNode $directive, array $op
}

return "@{$directive->name->value}" .
static::printLines($arguments, '(', ')', static::isLineTooLong($length), $indentation);
static::printChildrenBlock($arguments, '(', ')', static::isLineTooLong($length), $indentation);
}

/**
Expand Down Expand Up @@ -644,7 +645,7 @@ protected static function printValue($value, array $options, string $indentation
$values[] = $string;
}

$result = static::printLines($values, '[', ']', static::isLineTooLong($length), $indentation);
$result = static::printChildrenBlock($values, '[', ']', static::isLineTooLong($length), $indentation);
} else {
$result = Printer::doPrint($value);
}
Expand All @@ -655,7 +656,7 @@ protected static function printValue($value, array $options, string $indentation
/**
* @param array<string> $lines
*/
protected static function printLines(array $lines, string $begin, string $end, bool $forceMultiline, string $indentation = ''): string
protected static function printChildrenBlock(array $lines, string $begin, string $end, bool $forceMultiline, string $indentation = ''): string
{
$block = '';

Expand Down

0 comments on commit 13a189e

Please sign in to comment.