original_string: public function getVisitor(ValidationContext $context)
      {
          return [
              NodeKind::OPERATION_DEFINITION => function (OperationDefinitionNode $node) use ($context) {
                  if ($node->operation === 'subscription') {
                      if (count($node->selectionSet->selections) !== 1) {
                          $context->reportError(
                              new Error(
                                  $this->singleFieldOnlyMessage($node->name ? $node->name->value : null),
                                  array_slice($node->selectionSet->selections, 1)
                              )
                          );
                      }
                  }
              }
          ];
      }
code: public function getVisitor(ValidationContext $context)
      {
          return [
              NodeKind::OPERATION_DEFINITION => function (OperationDefinitionNode $node) use ($context) {
                  if ($node->operation === 'subscription') {
                      if (count($node->selectionSet->selections) !== 1) {
                          $context->reportError(
                              new Error(
                                  $this->singleFieldOnlyMessage($node->name ? $node->name->value : null),
                                  array_slice($node->selectionSet->selections, 1)
                              )
                          );
                      }
                  }
              }
          ];
      }
code_tokens: public function getVisitor ( ValidationContext $ context ) { return [ NodeKind :: OPERATION_DEFINITION => function ( OperationDefinitionNode $ node ) use ( $ context ) { if ( $ node -> operation === 'subscription' ) { if ( count ( $ node -> selectionSet -> selections ) !== 1 ) { $ context -> reportError ( new Error ( $ this -> singleFieldOnlyMessage ( $ node -> name ? $ node -> name -> value : null ) , array_slice ( $ node -> selectionSet -> selections , 1 ) ) ) ; } } } ] ; }
docstring: Returns structure suitable for GraphQL\Language\Visitor
  
  @see \GraphQL\Language\Visitor
  @param ValidationContext $context
  @return array
docstring_tokens: Returns structure suitable for GraphQL \ Language \ Visitor