@@ -76,6 +76,13 @@ public static function reset(): void
76
76
/**
77
77
* Process a file.
78
78
*
79
+ * @param \SplFileInfo $file
80
+ * @param ContainerBuilder $container
81
+ * @param array $configs
82
+ * @param bool $preProcess
83
+ *
84
+ * @return array
85
+ *
79
86
* @throws \ReflectionException
80
87
* @throws InvalidArgumentException
81
88
*/
@@ -112,7 +119,16 @@ private static function processFile(\SplFileInfo $file, ContainerBuilder $contai
112
119
}
113
120
114
121
/**
115
- * @param object $classAnnotation
122
+ * @param \ReflectionClass $reflectionEntity
123
+ * @param array $configs
124
+ * @param object $classAnnotation
125
+ * @param array $classAnnotations
126
+ * @param array $properties
127
+ * @param array $methods
128
+ * @param array $gqlTypes
129
+ * @param bool $preProcess
130
+ *
131
+ * @return array
116
132
*/
117
133
private static function classAnnotationsToGQLConfiguration (
118
134
\ReflectionClass $ reflectionEntity ,
@@ -351,6 +367,12 @@ private static function graphQLTypeConfigFromAnnotation(GQL\Type $typeAnnotation
351
367
/**
352
368
* Create a GraphQL Interface type configuration from annotations on properties.
353
369
*
370
+ * @param GQL\TypeInterface $interfaceAnnotation
371
+ * @param array $classAnnotations
372
+ * @param array $properties
373
+ * @param array $methods
374
+ * @param string $namespace
375
+ *
354
376
* @return array
355
377
*/
356
378
private static function typeInterfaceAnnotationToGQLConfiguration (GQL \TypeInterface $ interfaceAnnotation , array $ classAnnotations , array $ properties , array $ methods , string $ namespace )
@@ -370,6 +392,13 @@ private static function typeInterfaceAnnotationToGQLConfiguration(GQL\TypeInterf
370
392
371
393
/**
372
394
* Create a GraphQL Input type configuration from annotations on properties.
395
+ *
396
+ * @param GQL\Input $inputAnnotation
397
+ * @param array $classAnnotations
398
+ * @param array $properties
399
+ * @param string $namespace
400
+ *
401
+ * @return array
373
402
*/
374
403
private static function inputAnnotationToGQLConfiguration (GQL \Input $ inputAnnotation , array $ classAnnotations , array $ properties , string $ namespace ): array
375
404
{
@@ -384,6 +413,12 @@ private static function inputAnnotationToGQLConfiguration(GQL\Input $inputAnnota
384
413
385
414
/**
386
415
* Get a GraphQL scalar configuration from given scalar annotation.
416
+ *
417
+ * @param string $className
418
+ * @param GQL\Scalar $scalarAnnotation
419
+ * @param array $classAnnotations
420
+ *
421
+ * @return array
387
422
*/
388
423
private static function scalarAnnotationToGQLConfiguration (string $ className , GQL \Scalar $ scalarAnnotation , array $ classAnnotations ): array
389
424
{
@@ -406,6 +441,12 @@ private static function scalarAnnotationToGQLConfiguration(string $className, GQ
406
441
407
442
/**
408
443
* Get a GraphQL Enum configuration from given enum annotation.
444
+ *
445
+ * @param GQL\Enum $enumAnnotation
446
+ * @param array $classAnnotations
447
+ * @param array $constants
448
+ *
449
+ * @return array
409
450
*/
410
451
private static function enumAnnotationToGQLConfiguration (GQL \Enum $ enumAnnotation , array $ classAnnotations , array $ constants ): array
411
452
{
@@ -439,6 +480,13 @@ private static function enumAnnotationToGQLConfiguration(GQL\Enum $enumAnnotatio
439
480
440
481
/**
441
482
* Get a GraphQL Union configuration from given union annotation.
483
+ *
484
+ * @param string $className
485
+ * @param GQL\Union $unionAnnotation
486
+ * @param array $classAnnotations
487
+ * @param array $methods
488
+ *
489
+ * @return array
442
490
*/
443
491
private static function unionAnnotationToGQLConfiguration (string $ className , GQL \Union $ unionAnnotation , array $ classAnnotations , array $ methods ): array
444
492
{
@@ -465,6 +513,14 @@ private static function unionAnnotationToGQLConfiguration(string $className, GQL
465
513
466
514
/**
467
515
* Create GraphQL fields configuration based on annotations.
516
+ *
517
+ * @param string $namespace
518
+ * @param array $propertiesOrMethods
519
+ * @param bool $isInput
520
+ * @param bool $isMethod
521
+ * @param string $currentValue
522
+ *
523
+ * @return array
468
524
*/
469
525
private static function getGraphQLFieldsFromAnnotations (string $ namespace , array $ propertiesOrMethods , bool $ isInput = false , bool $ isMethod = false , string $ currentValue = 'value ' , string $ fieldAnnotationName = 'Field ' ): array
470
526
{
@@ -593,6 +649,11 @@ private static function getGraphQLFieldsFromAnnotations(string $namespace, array
593
649
/**
594
650
* Return fields config from Provider methods.
595
651
*
652
+ * @param string $namespace
653
+ * @param string $annotationName
654
+ * @param string $targetType
655
+ * @param bool $isRoot
656
+ *
596
657
* @return array
597
658
*/
598
659
private static function getGraphQLFieldsFromProviders (string $ namespace , string $ annotationName , string $ targetType , bool $ isRoot = false )
@@ -638,6 +699,11 @@ private static function getGraphQLFieldsFromProviders(string $namespace, string
638
699
639
700
/**
640
701
* Get the config for description & deprecation reason.
702
+ *
703
+ * @param array $annotations
704
+ * @param bool $withDeprecation
705
+ *
706
+ * @return array
641
707
*/
642
708
private static function getDescriptionConfiguration (array $ annotations , bool $ withDeprecation = false ): array
643
709
{
@@ -662,6 +728,8 @@ private static function getDescriptionConfiguration(array $annotations, bool $wi
662
728
*
663
729
* @param array $args
664
730
* @param \ReflectionMethod $method
731
+ *
732
+ * @return array
665
733
*/
666
734
private static function getArgs (array $ args = null , \ReflectionMethod $ method = null ): array
667
735
{
@@ -681,6 +749,10 @@ private static function getArgs(array $args = null, \ReflectionMethod $method =
681
749
682
750
/**
683
751
* Format an array of args to a list of arguments in an expression.
752
+ *
753
+ * @param array $args
754
+ *
755
+ * @return string
684
756
*/
685
757
private static function formatArgsForExpression (array $ args ): string
686
758
{
@@ -694,6 +766,10 @@ private static function formatArgsForExpression(array $args): string
694
766
695
767
/**
696
768
* Format a namespace to be used in an expression (double escape).
769
+ *
770
+ * @param string $namespace
771
+ *
772
+ * @return string
697
773
*/
698
774
private static function formatNamespaceForExpression (string $ namespace ): string
699
775
{
@@ -703,6 +779,7 @@ private static function formatNamespaceForExpression(string $namespace): string
703
779
/**
704
780
* Get the first annotation matching given class.
705
781
*
782
+ * @param array $annotations
706
783
* @param string|array $annotationClass
707
784
*
708
785
* @return mixed
@@ -727,6 +804,8 @@ private static function getFirstAnnotationMatching(array $annotations, $annotati
727
804
/**
728
805
* Format an expression (ie. add "@=" if not set).
729
806
*
807
+ * @param string $expression
808
+ *
730
809
* @return string
731
810
*/
732
811
private static function formatExpression (string $ expression )
@@ -737,6 +816,9 @@ private static function formatExpression(string $expression)
737
816
/**
738
817
* Suffix a name if it is not already.
739
818
*
819
+ * @param string $name
820
+ * @param string $suffix
821
+ *
740
822
* @return string
741
823
*/
742
824
private static function suffixName (string $ name , string $ suffix )
@@ -747,6 +829,11 @@ private static function suffixName(string $name, string $suffix)
747
829
/**
748
830
* Try to guess a field type base on is annotations.
749
831
*
832
+ * @param string $namespace
833
+ * @param array $annotations
834
+ *
835
+ * @return string
836
+ *
750
837
* @throws \RuntimeException
751
838
*/
752
839
private static function guessType (string $ namespace , array $ annotations ): string
@@ -798,6 +885,11 @@ private static function guessType(string $namespace, array $annotations): string
798
885
/**
799
886
* Resolve a FQN from classname and namespace.
800
887
*
888
+ * @param string $className
889
+ * @param string $namespace
890
+ *
891
+ * @return string
892
+ *
801
893
* @internal
802
894
*/
803
895
public static function fullyQualifiedClassName (string $ className , string $ namespace ): string
@@ -811,6 +903,10 @@ public static function fullyQualifiedClassName(string $className, string $namesp
811
903
812
904
/**
813
905
* Resolve a GraphQLType from a doctrine type.
906
+ *
907
+ * @param string $doctrineType
908
+ *
909
+ * @return string|null
814
910
*/
815
911
private static function resolveTypeFromDoctrineType (string $ doctrineType ): ?string
816
912
{
@@ -888,7 +984,10 @@ private static function resolveGraphQLTypeFromReflectionType(\ReflectionType $ty
888
984
/**
889
985
* Resolve a GraphQL Type from a class name.
890
986
*
891
- * @param array $wantedTypes
987
+ * @param string $className
988
+ * @param array $wantedTypes
989
+ *
990
+ * @return string|null
892
991
*/
893
992
private static function resolveTypeFromClass (string $ className , array $ wantedTypes = null ): ?string
894
993
{
@@ -906,6 +1005,8 @@ private static function resolveTypeFromClass(string $className, array $wantedTyp
906
1005
/**
907
1006
* Resolve a PHP class from a GraphQL type.
908
1007
*
1008
+ * @param string $type
1009
+ *
909
1010
* @return string|array|null
910
1011
*/
911
1012
private static function resolveClassFromType (string $ type )
@@ -915,6 +1016,10 @@ private static function resolveClassFromType(string $type)
915
1016
916
1017
/**
917
1018
* Convert a PHP Builtin type to a GraphQL type.
1019
+ *
1020
+ * @param string $phpType
1021
+ *
1022
+ * @return string|null
918
1023
*/
919
1024
private static function resolveTypeFromPhpType (string $ phpType ): ?string
920
1025
{
0 commit comments