Remove pass-by-reference for `$result` in `ReferenceExecutor` by spawnia · Pull Request #1780 · webonyx/graphql-php

Since the ReferenceExecutor is not final, one could be extending it.

For example:

final class TestReferenceExecutor extends ReferenceExecutor {
    protected function completeAbstractValue(
        AbstractType $returnType,
        \ArrayObject $fieldNodes,
        ResolveInfo $info,
        array $path,
        array $unaliasedPath,
        &$result,
        $contextValue)
    {
        return parent::completeAbstractValue(
            $returnType,
            $fieldNodes,
            $info,
            $path,
            $unaliasedPath,
            $result,
            $contextValue,
        );
    }
}

This would fail now:

Declaration should be compatible with ReferenceExecutor->completeAbstractValue(returnType: \GraphQL\Type\Definition\AbstractType|\GraphQL\Type\Definition\Type&\GraphQL\Type\Definition\AbstractType, fieldNodes: \ArrayObject, info: \GraphQL\Type\Definition\ResolveInfo, path: int[]|string[], unaliasedPath: int[]|string[], result: mixed, contextValue: mixed)