original_string: public function close()
      {
          if ($this->isClosed) {
              // TODO: Should this be an error condition? e.g. BadMethodCallException
              return;
          }
  
          if (strlen($this->buffer) > 0) {
              $this->insertChunkFromBuffer();
          }
  
          $this->fileCollectionInsert();
          $this->isClosed = true;
      }
code: public function close()
      {
          if ($this->isClosed) {
              // TODO: Should this be an error condition? e.g. BadMethodCallException
              return;
          }
  
          if (strlen($this->buffer) > 0) {
              $this->insertChunkFromBuffer();
          }
  
          $this->fileCollectionInsert();
          $this->isClosed = true;
      }
code_tokens: public function close ( ) { if ( $ this -> isClosed ) { // TODO: Should this be an error condition? e.g. BadMethodCallException return ; } if ( strlen ( $ this -> buffer ) > 0 ) { $ this -> insertChunkFromBuffer ( ) ; } $ this -> fileCollectionInsert ( ) ; $ this -> isClosed = true ; }
docstring: Closes an active stream and flushes all buffered data to GridFS.
docstring_tokens: Closes an active stream and flushes all buffered data to GridFS .