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