@@ -99,7 +99,7 @@ private function completeFieldArguments(Field $field, ReflectionMethod $method,
9999 $ arg = $ argsFromAnnotations [$ param ->getName ()] ?? new Argument ();
100100 $ args [$ param ->getName ()] = $ arg ;
101101
102- $ this ->completeArgumentFromTypeHint ($ method , $ param , $ arg , $ docBlock );
102+ $ this ->completeArgumentFromTypeHint ($ arg , $ method , $ param , $ docBlock );
103103 }
104104
105105 $ extraAnnotations = array_diff (array_keys ($ argsFromAnnotations ), array_keys ($ args ));
@@ -113,12 +113,12 @@ private function completeFieldArguments(Field $field, ReflectionMethod $method,
113113 /**
114114 * Complete a single argument from its type hint
115115 *
116+ * @param Argument $arg
116117 * @param ReflectionMethod $method
117118 * @param ReflectionParameter $param
118- * @param Argument $arg
119119 * @param DocBlockReader $docBlock
120120 */
121- private function completeArgumentFromTypeHint (ReflectionMethod $ method , ReflectionParameter $ param , Argument $ arg , DocBlockReader $ docBlock ): void
121+ private function completeArgumentFromTypeHint (Argument $ arg , ReflectionMethod $ method , ReflectionParameter $ param , DocBlockReader $ docBlock ): void
122122 {
123123 if (!$ arg ->name ) {
124124 $ arg ->name = $ param ->getName ();
@@ -132,6 +132,19 @@ private function completeArgumentFromTypeHint(ReflectionMethod $method, Reflecti
132132 $ arg ->defaultValue = $ param ->getDefaultValue ();
133133 }
134134
135+ $ this ->completeArgumentTypeFromTypeHint ($ arg , $ method , $ param , $ docBlock );
136+ }
137+
138+ /**
139+ * Complete a single argument type from its type hint and doc block
140+ *
141+ * @param Argument $arg
142+ * @param ReflectionMethod $method
143+ * @param ReflectionParameter $param
144+ * @param DocBlockReader $docBlock
145+ */
146+ private function completeArgumentTypeFromTypeHint (Argument $ arg , ReflectionMethod $ method , ReflectionParameter $ param , DocBlockReader $ docBlock ): void
147+ {
135148 if (!$ arg ->type ) {
136149 $ typeDeclaration = $ docBlock ->getParameterType ($ param );
137150 $ this ->throwIfArray ($ param , $ typeDeclaration );
0 commit comments