Skip to content

Commit 97ae597

Browse files
committed
Restore docblocks
1 parent 72ceb30 commit 97ae597

File tree

1 file changed

+107
-2
lines changed

1 file changed

+107
-2
lines changed

src/Config/Parser/AnnotationParser.php

Lines changed: 107 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ public static function reset(): void
7676
/**
7777
* Process a file.
7878
*
79+
* @param \SplFileInfo $file
80+
* @param ContainerBuilder $container
81+
* @param array $configs
82+
* @param bool $preProcess
83+
*
84+
* @return array
85+
*
7986
* @throws \ReflectionException
8087
* @throws InvalidArgumentException
8188
*/
@@ -112,7 +119,16 @@ private static function processFile(\SplFileInfo $file, ContainerBuilder $contai
112119
}
113120

114121
/**
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
116132
*/
117133
private static function classAnnotationsToGQLConfiguration(
118134
\ReflectionClass $reflectionEntity,
@@ -351,6 +367,12 @@ private static function graphQLTypeConfigFromAnnotation(GQL\Type $typeAnnotation
351367
/**
352368
* Create a GraphQL Interface type configuration from annotations on properties.
353369
*
370+
* @param GQL\TypeInterface $interfaceAnnotation
371+
* @param array $classAnnotations
372+
* @param array $properties
373+
* @param array $methods
374+
* @param string $namespace
375+
*
354376
* @return array
355377
*/
356378
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
370392

371393
/**
372394
* 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
373402
*/
374403
private static function inputAnnotationToGQLConfiguration(GQL\Input $inputAnnotation, array $classAnnotations, array $properties, string $namespace): array
375404
{
@@ -384,6 +413,12 @@ private static function inputAnnotationToGQLConfiguration(GQL\Input $inputAnnota
384413

385414
/**
386415
* 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
387422
*/
388423
private static function scalarAnnotationToGQLConfiguration(string $className, GQL\Scalar $scalarAnnotation, array $classAnnotations): array
389424
{
@@ -406,6 +441,12 @@ private static function scalarAnnotationToGQLConfiguration(string $className, GQ
406441

407442
/**
408443
* 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
409450
*/
410451
private static function enumAnnotationToGQLConfiguration(GQL\Enum $enumAnnotation, array $classAnnotations, array $constants): array
411452
{
@@ -439,6 +480,13 @@ private static function enumAnnotationToGQLConfiguration(GQL\Enum $enumAnnotatio
439480

440481
/**
441482
* 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
442490
*/
443491
private static function unionAnnotationToGQLConfiguration(string $className, GQL\Union $unionAnnotation, array $classAnnotations, array $methods): array
444492
{
@@ -465,6 +513,14 @@ private static function unionAnnotationToGQLConfiguration(string $className, GQL
465513

466514
/**
467515
* 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
468524
*/
469525
private static function getGraphQLFieldsFromAnnotations(string $namespace, array $propertiesOrMethods, bool $isInput = false, bool $isMethod = false, string $currentValue = 'value', string $fieldAnnotationName = 'Field'): array
470526
{
@@ -593,6 +649,11 @@ private static function getGraphQLFieldsFromAnnotations(string $namespace, array
593649
/**
594650
* Return fields config from Provider methods.
595651
*
652+
* @param string $namespace
653+
* @param string $annotationName
654+
* @param string $targetType
655+
* @param bool $isRoot
656+
*
596657
* @return array
597658
*/
598659
private static function getGraphQLFieldsFromProviders(string $namespace, string $annotationName, string $targetType, bool $isRoot = false)
@@ -638,6 +699,11 @@ private static function getGraphQLFieldsFromProviders(string $namespace, string
638699

639700
/**
640701
* Get the config for description & deprecation reason.
702+
*
703+
* @param array $annotations
704+
* @param bool $withDeprecation
705+
*
706+
* @return array
641707
*/
642708
private static function getDescriptionConfiguration(array $annotations, bool $withDeprecation = false): array
643709
{
@@ -662,6 +728,8 @@ private static function getDescriptionConfiguration(array $annotations, bool $wi
662728
*
663729
* @param array $args
664730
* @param \ReflectionMethod $method
731+
*
732+
* @return array
665733
*/
666734
private static function getArgs(array $args = null, \ReflectionMethod $method = null): array
667735
{
@@ -681,6 +749,10 @@ private static function getArgs(array $args = null, \ReflectionMethod $method =
681749

682750
/**
683751
* Format an array of args to a list of arguments in an expression.
752+
*
753+
* @param array $args
754+
*
755+
* @return string
684756
*/
685757
private static function formatArgsForExpression(array $args): string
686758
{
@@ -694,6 +766,10 @@ private static function formatArgsForExpression(array $args): string
694766

695767
/**
696768
* Format a namespace to be used in an expression (double escape).
769+
*
770+
* @param string $namespace
771+
*
772+
* @return string
697773
*/
698774
private static function formatNamespaceForExpression(string $namespace): string
699775
{
@@ -703,6 +779,7 @@ private static function formatNamespaceForExpression(string $namespace): string
703779
/**
704780
* Get the first annotation matching given class.
705781
*
782+
* @param array $annotations
706783
* @param string|array $annotationClass
707784
*
708785
* @return mixed
@@ -727,6 +804,8 @@ private static function getFirstAnnotationMatching(array $annotations, $annotati
727804
/**
728805
* Format an expression (ie. add "@=" if not set).
729806
*
807+
* @param string $expression
808+
*
730809
* @return string
731810
*/
732811
private static function formatExpression(string $expression)
@@ -737,6 +816,9 @@ private static function formatExpression(string $expression)
737816
/**
738817
* Suffix a name if it is not already.
739818
*
819+
* @param string $name
820+
* @param string $suffix
821+
*
740822
* @return string
741823
*/
742824
private static function suffixName(string $name, string $suffix)
@@ -747,6 +829,11 @@ private static function suffixName(string $name, string $suffix)
747829
/**
748830
* Try to guess a field type base on is annotations.
749831
*
832+
* @param string $namespace
833+
* @param array $annotations
834+
*
835+
* @return string
836+
*
750837
* @throws \RuntimeException
751838
*/
752839
private static function guessType(string $namespace, array $annotations): string
@@ -798,6 +885,11 @@ private static function guessType(string $namespace, array $annotations): string
798885
/**
799886
* Resolve a FQN from classname and namespace.
800887
*
888+
* @param string $className
889+
* @param string $namespace
890+
*
891+
* @return string
892+
*
801893
* @internal
802894
*/
803895
public static function fullyQualifiedClassName(string $className, string $namespace): string
@@ -811,6 +903,10 @@ public static function fullyQualifiedClassName(string $className, string $namesp
811903

812904
/**
813905
* Resolve a GraphQLType from a doctrine type.
906+
*
907+
* @param string $doctrineType
908+
*
909+
* @return string|null
814910
*/
815911
private static function resolveTypeFromDoctrineType(string $doctrineType): ?string
816912
{
@@ -888,7 +984,10 @@ private static function resolveGraphQLTypeFromReflectionType(\ReflectionType $ty
888984
/**
889985
* Resolve a GraphQL Type from a class name.
890986
*
891-
* @param array $wantedTypes
987+
* @param string $className
988+
* @param array $wantedTypes
989+
*
990+
* @return string|null
892991
*/
893992
private static function resolveTypeFromClass(string $className, array $wantedTypes = null): ?string
894993
{
@@ -906,6 +1005,8 @@ private static function resolveTypeFromClass(string $className, array $wantedTyp
9061005
/**
9071006
* Resolve a PHP class from a GraphQL type.
9081007
*
1008+
* @param string $type
1009+
*
9091010
* @return string|array|null
9101011
*/
9111012
private static function resolveClassFromType(string $type)
@@ -915,6 +1016,10 @@ private static function resolveClassFromType(string $type)
9151016

9161017
/**
9171018
* Convert a PHP Builtin type to a GraphQL type.
1019+
*
1020+
* @param string $phpType
1021+
*
1022+
* @return string|null
9181023
*/
9191024
private static function resolveTypeFromPhpType(string $phpType): ?string
9201025
{

0 commit comments

Comments
 (0)