1212
1313abstract class Values
1414{
15+ /**
16+ * @param Schema $schema
17+ * @param array $variableDefinitions
18+ * @param array $inputs
19+ * @return array
20+ */
1521 public static function getVariableValues (Schema $ schema , array $ variableDefinitions , array $ inputs ): array
1622 {
1723 $ errors = [];
@@ -23,6 +29,14 @@ public static function getVariableValues(Schema $schema, array $variableDefiniti
2329 return $ errors ;
2430 }
2531
32+ /**
33+ * @param Schema $schema
34+ * @param array $variableDefinitions
35+ * @param array $inputs
36+ * @return array
37+ * @throws GraphQLError
38+ * @throws \GraphQL\Errors\ValidationError
39+ */
2640 public static function coerceVariableValues (Schema $ schema , array $ variableDefinitions , array $ inputs ): array
2741 {
2842 $ coercedValues = [];
@@ -69,6 +83,13 @@ public static function coerceVariableValues(Schema $schema, array $variableDefin
6983 return $ coercedValues ;
7084 }
7185
86+ /**
87+ * @param GraphQLDirective $directiveDef
88+ * @param $node
89+ * @param $variableValues
90+ * @return array|null
91+ * @throws GraphQLError
92+ */
7293 public static function getDirectiveValues (GraphQLDirective $ directiveDef , $ node , $ variableValues ): ?array
7394 {
7495 $ directiveNode = array_filter ($ node ["directives " ], function ($ directive ) use ($ directiveDef ) {
@@ -83,6 +104,14 @@ public static function getDirectiveValues(GraphQLDirective $directiveDef, $node,
83104 return null ;
84105 }
85106
107+ /**
108+ * @param $def
109+ * @param $node
110+ * @param $variableValues
111+ * @return array
112+ * @throws GraphQLError
113+ * @throws \GraphQL\Errors\ValidationError
114+ */
86115 public static function getArgumentValues ($ def , $ node , $ variableValues ): array
87116 {
88117 $ coercedValues = [];
@@ -99,7 +128,7 @@ public static function getArgumentValues($def, $node, $variableValues): array
99128 $ argumentNode = $ argNodeMap [$ name ] ?? null ;
100129
101130 // if no argument specified in AST, check if default argument exists and is valid
102- if (! $ argumentNode ) {
131+ if ($ argumentNode === null ) {
103132 if ($ argDef ->getDefaultValue () !== null ) {
104133 $ coercedValues [$ name ] = $ argDef ->getDefaultValue ();
105134 } else if ($ argType ->isNonNullType ()) {
0 commit comments