original_string: public function getFileIdForStream($stream)
      {
          $file = $this->getRawFileDocumentForStream($stream);
  
          /* Filter the raw document through the specified type map, but override
           * the root type so we can reliably access the ID.
           */
          $typeMap = ['root' => 'stdClass'] + $this->typeMap;
          $file = \MongoDB\apply_type_map_to_document($file, $typeMap);
  
          if ( ! isset($file->_id) && ! property_exists($file, '_id')) {
              throw new CorruptFileException('file._id does not exist');
          }
  
          return $file->_id;
      }
code: public function getFileIdForStream($stream)
      {
          $file = $this->getRawFileDocumentForStream($stream);
  
          /* Filter the raw document through the specified type map, but override
           * the root type so we can reliably access the ID.
           */
          $typeMap = ['root' => 'stdClass'] + $this->typeMap;
          $file = \MongoDB\apply_type_map_to_document($file, $typeMap);
  
          if ( ! isset($file->_id) && ! property_exists($file, '_id')) {
              throw new CorruptFileException('file._id does not exist');
          }
  
          return $file->_id;
      }
code_tokens: public function getFileIdForStream ( $ stream ) { $ file = $ this -> getRawFileDocumentForStream ( $ stream ) ; /* Filter the raw document through the specified type map, but override
           * the root type so we can reliably access the ID.
           */ $ typeMap = [ 'root' => 'stdClass' ] + $ this -> typeMap ; $ file = \ MongoDB \ apply_type_map_to_document ( $ file , $ typeMap ) ; if ( ! isset ( $ file -> _id ) && ! property_exists ( $ file , '_id' ) ) { throw new CorruptFileException ( 'file._id does not exist' ) ; } return $ file -> _id ; }
docstring: Gets the file document's ID of the GridFS file associated with a stream.
  
  @param resource $stream GridFS stream
  @return mixed
  @throws CorruptFileException if the file "_id" field does not exist
  @throws InvalidArgumentException if $stream is not a GridFS stream
  @throws DriverRuntimeException for other driver errors (e.g. connection errors)
docstring_tokens: Gets the file document s ID of the GridFS file associated with a stream .