original_string: private function createCommand(Server $server)
      {
          $cmd = [
              'mapReduce' => $this->collectionName,
              'map' => $this->map,
              'reduce' => $this->reduce,
              'out' => $this->out,
          ];
  
          foreach (['finalize', 'jsMode', 'limit', 'maxTimeMS', 'verbose'] as $option) {
              if (isset($this->options[$option])) {
                  $cmd[$option] = $this->options[$option];
              }
          }
  
          foreach (['collation', 'query', 'scope', 'sort'] as $option) {
              if (isset($this->options[$option])) {
                  $cmd[$option] = (object) $this->options[$option];
              }
          }
  
          if (isset($this->options['bypassDocumentValidation']) && \MongoDB\server_supports_feature($server, self::$wireVersionForDocumentLevelValidation)) {
              $cmd['bypassDocumentValidation'] = $this->options['bypassDocumentValidation'];
          }
  
          return new Command($cmd);
      }
code: private function createCommand(Server $server)
      {
          $cmd = [
              'mapReduce' => $this->collectionName,
              'map' => $this->map,
              'reduce' => $this->reduce,
              'out' => $this->out,
          ];
  
          foreach (['finalize', 'jsMode', 'limit', 'maxTimeMS', 'verbose'] as $option) {
              if (isset($this->options[$option])) {
                  $cmd[$option] = $this->options[$option];
              }
          }
  
          foreach (['collation', 'query', 'scope', 'sort'] as $option) {
              if (isset($this->options[$option])) {
                  $cmd[$option] = (object) $this->options[$option];
              }
          }
  
          if (isset($this->options['bypassDocumentValidation']) && \MongoDB\server_supports_feature($server, self::$wireVersionForDocumentLevelValidation)) {
              $cmd['bypassDocumentValidation'] = $this->options['bypassDocumentValidation'];
          }
  
          return new Command($cmd);
      }
code_tokens: private function createCommand ( Server $ server ) { $ cmd = [ 'mapReduce' => $ this -> collectionName , 'map' => $ this -> map , 'reduce' => $ this -> reduce , 'out' => $ this -> out , ] ; foreach ( [ 'finalize' , 'jsMode' , 'limit' , 'maxTimeMS' , 'verbose' ] as $ option ) { if ( isset ( $ this -> options [ $ option ] ) ) { $ cmd [ $ option ] = $ this -> options [ $ option ] ; } } foreach ( [ 'collation' , 'query' , 'scope' , 'sort' ] as $ option ) { if ( isset ( $ this -> options [ $ option ] ) ) { $ cmd [ $ option ] = ( object ) $ this -> options [ $ option ] ; } } if ( isset ( $ this -> options [ 'bypassDocumentValidation' ] ) && \ MongoDB \ server_supports_feature ( $ server , self :: $ wireVersionForDocumentLevelValidation ) ) { $ cmd [ 'bypassDocumentValidation' ] = $ this -> options [ 'bypassDocumentValidation' ] ; } return new Command ( $ cmd ) ; }
docstring: Create the mapReduce command.
  
  @param Server $server
  @return Command
docstring_tokens: Create the mapReduce command .