@@ -62,7 +62,7 @@ static function ($type) : bool {
62
62
/**
63
63
* @param array<string, bool> $options
64
64
*/
65
- private static function printFilteredSchema (Schema $ schema , callable $ directiveFilter , callable $ typeFilter , array $ options ) : string
65
+ protected static function printFilteredSchema (Schema $ schema , callable $ directiveFilter , callable $ typeFilter , array $ options ) : string
66
66
{
67
67
$ directives = array_filter ($ schema ->getDirectives (), $ directiveFilter );
68
68
@@ -95,7 +95,7 @@ static function ($type) use ($options) : string {
95
95
);
96
96
}
97
97
98
- private static function printSchemaDefinition (Schema $ schema ) : string
98
+ protected static function printSchemaDefinition (Schema $ schema ) : string
99
99
{
100
100
if (self ::isSchemaOfCommonNames ($ schema )) {
101
101
return '' ;
@@ -133,7 +133,7 @@ private static function printSchemaDefinition(Schema $schema) : string
133
133
*
134
134
* When using this naming convention, the schema description can be omitted.
135
135
*/
136
- private static function isSchemaOfCommonNames (Schema $ schema ) : bool
136
+ protected static function isSchemaOfCommonNames (Schema $ schema ) : bool
137
137
{
138
138
$ queryType = $ schema ->getQueryType ();
139
139
if ($ queryType !== null && $ queryType ->name !== 'Query ' ) {
@@ -153,7 +153,7 @@ private static function isSchemaOfCommonNames(Schema $schema) : bool
153
153
/**
154
154
* @param array<string, bool> $options
155
155
*/
156
- private static function printDirective (Directive $ directive , array $ options ) : string
156
+ protected static function printDirective (Directive $ directive , array $ options ) : string
157
157
{
158
158
return self ::printDescription ($ options , $ directive )
159
159
. 'directive @ ' . $ directive ->name
@@ -165,7 +165,7 @@ private static function printDirective(Directive $directive, array $options) : s
165
165
/**
166
166
* @param array<string, bool> $options
167
167
*/
168
- private static function printDescription (array $ options , $ def , $ indentation = '' , $ firstInBlock = true ) : string
168
+ protected static function printDescription (array $ options , $ def , $ indentation = '' , $ firstInBlock = true ) : string
169
169
{
170
170
if (! $ def ->description ) {
171
171
return '' ;
@@ -212,7 +212,7 @@ private static function printDescription(array $options, $def, $indentation = ''
212
212
/**
213
213
* @return string[]
214
214
*/
215
- private static function descriptionLines (string $ description , int $ maxLen ) : array
215
+ protected static function descriptionLines (string $ description , int $ maxLen ) : array
216
216
{
217
217
$ lines = [];
218
218
$ rawLines = explode ("\n" , $ description );
@@ -235,7 +235,7 @@ private static function descriptionLines(string $description, int $maxLen) : arr
235
235
/**
236
236
* @return string[]
237
237
*/
238
- private static function breakLine (string $ line , int $ maxLen ) : array
238
+ protected static function breakLine (string $ line , int $ maxLen ) : array
239
239
{
240
240
if (strlen ($ line ) < $ maxLen + 5 ) {
241
241
return [$ line ];
@@ -246,7 +246,7 @@ private static function breakLine(string $line, int $maxLen) : array
246
246
return array_map ('trim ' , $ parts );
247
247
}
248
248
249
- private static function printDescriptionWithComments ($ lines , $ indentation , $ firstInBlock ) : string
249
+ protected static function printDescriptionWithComments ($ lines , $ indentation , $ firstInBlock ) : string
250
250
{
251
251
$ description = $ indentation && ! $ firstInBlock ? "\n" : '' ;
252
252
foreach ($ lines as $ line ) {
@@ -260,15 +260,15 @@ private static function printDescriptionWithComments($lines, $indentation, $firs
260
260
return $ description ;
261
261
}
262
262
263
- private static function escapeQuote ($ line ) : string
263
+ protected static function escapeQuote ($ line ) : string
264
264
{
265
265
return str_replace ('""" ' , '\\""" ' , $ line );
266
266
}
267
267
268
268
/**
269
269
* @param array<string, bool> $options
270
270
*/
271
- private static function printArgs (array $ options , $ args , $ indentation = '' ) : string
271
+ protected static function printArgs (array $ options , $ args , $ indentation = '' ) : string
272
272
{
273
273
if (! $ args ) {
274
274
return '' ;
@@ -301,7 +301,7 @@ static function ($arg, $i) use ($indentation, $options) : string {
301
301
);
302
302
}
303
303
304
- private static function printInputValue ($ arg ) : string
304
+ protected static function printInputValue ($ arg ) : string
305
305
{
306
306
$ argDecl = $ arg ->name . ': ' . (string ) $ arg ->getType ();
307
307
if ($ arg ->defaultValueExists ()) {
@@ -346,15 +346,15 @@ public static function printType(Type $type, array $options = []) : string
346
346
/**
347
347
* @param array<string, bool> $options
348
348
*/
349
- private static function printScalar (ScalarType $ type , array $ options ) : string
349
+ protected static function printScalar (ScalarType $ type , array $ options ) : string
350
350
{
351
351
return sprintf ('%sscalar %s ' , self ::printDescription ($ options , $ type ), $ type ->name );
352
352
}
353
353
354
354
/**
355
355
* @param array<string, bool> $options
356
356
*/
357
- private static function printObject (ObjectType $ type , array $ options ) : string
357
+ protected static function printObject (ObjectType $ type , array $ options ) : string
358
358
{
359
359
$ interfaces = $ type ->getInterfaces ();
360
360
$ implementedInterfaces = ! empty ($ interfaces )
@@ -376,7 +376,7 @@ static function (InterfaceType $interface) : string {
376
376
/**
377
377
* @param array<string, bool> $options
378
378
*/
379
- private static function printFields (array $ options , $ type ) : string
379
+ protected static function printFields (array $ options , $ type ) : string
380
380
{
381
381
$ fields = array_values ($ type ->getFields ());
382
382
@@ -394,7 +394,7 @@ static function ($f, $i) use ($options) : string {
394
394
);
395
395
}
396
396
397
- private static function printDeprecated ($ fieldOrEnumVal ) : string
397
+ protected static function printDeprecated ($ fieldOrEnumVal ) : string
398
398
{
399
399
$ reason = $ fieldOrEnumVal ->deprecationReason ;
400
400
if ($ reason === null ) {
@@ -411,7 +411,7 @@ private static function printDeprecated($fieldOrEnumVal) : string
411
411
/**
412
412
* @param array<string, bool> $options
413
413
*/
414
- private static function printInterface (InterfaceType $ type , array $ options ) : string
414
+ protected static function printInterface (InterfaceType $ type , array $ options ) : string
415
415
{
416
416
return self ::printDescription ($ options , $ type ) .
417
417
sprintf ("interface %s { \n%s \n} " , $ type ->name , self ::printFields ($ options , $ type ));
@@ -420,7 +420,7 @@ private static function printInterface(InterfaceType $type, array $options) : st
420
420
/**
421
421
* @param array<string, bool> $options
422
422
*/
423
- private static function printUnion (UnionType $ type , array $ options ) : string
423
+ protected static function printUnion (UnionType $ type , array $ options ) : string
424
424
{
425
425
return self ::printDescription ($ options , $ type ) .
426
426
sprintf ('union %s = %s ' , $ type ->name , implode (' | ' , $ type ->getTypes ()));
@@ -429,7 +429,7 @@ private static function printUnion(UnionType $type, array $options) : string
429
429
/**
430
430
* @param array<string, bool> $options
431
431
*/
432
- private static function printEnum (EnumType $ type , array $ options ) : string
432
+ protected static function printEnum (EnumType $ type , array $ options ) : string
433
433
{
434
434
return self ::printDescription ($ options , $ type ) .
435
435
sprintf ("enum %s { \n%s \n} " , $ type ->name , self ::printEnumValues ($ type ->getValues (), $ options ));
@@ -438,7 +438,7 @@ private static function printEnum(EnumType $type, array $options) : string
438
438
/**
439
439
* @param array<string, bool> $options
440
440
*/
441
- private static function printEnumValues ($ values , array $ options ) : string
441
+ protected static function printEnumValues ($ values , array $ options ) : string
442
442
{
443
443
return implode (
444
444
"\n" ,
@@ -456,7 +456,7 @@ static function ($value, $i) use ($options) : string {
456
456
/**
457
457
* @param array<string, bool> $options
458
458
*/
459
- private static function printInputObject (InputObjectType $ type , array $ options ) : string
459
+ protected static function printInputObject (InputObjectType $ type , array $ options ) : string
460
460
{
461
461
$ fields = array_values ($ type ->getFields ());
462
462
0 commit comments