@@ -61,7 +61,12 @@ class ReferenceExecutor implements ExecutorImplementation
6161 */
6262 protected \SplObjectStorage $ subFieldCache ;
6363
64- /** @var \SplObjectStorage<FieldDefinition, \SplObjectStorage<FieldNode, mixed>> */
64+ /**
65+ * @var \SplObjectStorage<
66+ * FieldDefinition,
67+ * \SplObjectStorage<FieldNode, mixed>
68+ * >
69+ */
6570 protected \SplObjectStorage $ fieldArgsCache ;
6671
6772 protected function __construct (ExecutionContext $ context )
@@ -94,7 +99,7 @@ public static function create(
9499 array $ variableValues ,
95100 ?string $ operationName ,
96101 callable $ fieldResolver ,
97- callable $ argsMapper
102+ ? callable $ argsMapper = null // TODO make non-optional in next major release
98103 ): ExecutorImplementation {
99104 $ exeContext = static ::buildExecutionContext (
100105 $ schema ,
@@ -104,7 +109,7 @@ public static function create(
104109 $ variableValues ,
105110 $ operationName ,
106111 $ fieldResolver ,
107- $ argsMapper ,
112+ $ argsMapper ?? Executor:: getDefaultArgsMapper () ,
108113 $ promiseAdapter ,
109114 );
110115
@@ -128,8 +133,8 @@ public function doExecute(): Promise
128133 }
129134
130135 /**
131- * Constructs an ExecutionContext object from the arguments passed to
132- * execute, which we will pass throughout the other execution methods.
136+ * Constructs an ExecutionContext object from the arguments passed to execute,
137+ * which we will pass throughout the other execution methods.
133138 *
134139 * @param mixed $rootValue
135140 * @param mixed $contextValue
@@ -741,7 +746,7 @@ protected function resolveFieldValueOrError(
741746 try {
742747 // Build a map of arguments from the field.arguments AST, using the
743748 // variables scope to fulfill any variable references.
744- /** @phpstan-ignore-next-line ignored because no way to tell phpstan what are generics of SplObjectStorage without assign it to var first */
749+ // @phpstan-ignore-next-line generics of SplObjectStorage are not inferred from empty instantiation
745750 $ this ->fieldArgsCache [$ fieldDef ] ??= new \SplObjectStorage ();
746751
747752 $ args = $ this ->fieldArgsCache [$ fieldDef ][$ fieldNode ] ??= $ argsMapper (Values::getArgumentValues (
@@ -1331,6 +1336,7 @@ protected function collectAndExecuteSubfields(
13311336 */
13321337 protected function collectSubFields (ObjectType $ returnType , \ArrayObject $ fieldNodes ): \ArrayObject
13331338 {
1339+ // @phpstan-ignore-next-line generics of SplObjectStorage are not inferred from empty instantiation
13341340 $ returnTypeCache = $ this ->subFieldCache [$ returnType ] ??= new \SplObjectStorage ();
13351341
13361342 if (! isset ($ returnTypeCache [$ fieldNodes ])) {
0 commit comments