diff --git a/src/Utils/SchemaPrinter.php b/src/Utils/SchemaPrinter.php index 1eb7076bd..3f85cdcd8 100644 --- a/src/Utils/SchemaPrinter.php +++ b/src/Utils/SchemaPrinter.php @@ -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); } /** @@ -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"; } @@ -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); } /** @@ -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); } /** @@ -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); } @@ -655,7 +656,7 @@ protected static function printValue($value, array $options, string $indentation /** * @param array $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 = '';