original_string: protected function flushWrites()
      {
          // Skip this if there is no queued write items
          if (count($this->getQueue('write')) === 0) {
              return;
          }
  
          // Update the state of the queued attachment
          $this->updateQueueState(self::QUEUE_WORKING);
  
          foreach ($this->getQueue('write') as $name => $style) {
              if ($style && $this->uploaded_file->isImage()) {
                  $file = $this->getResizer()
                      ->resize($this->uploaded_file, $style);
              }
              else {
                  $file = $this->uploaded_file->getRealPath();
              }
  
              // Only move it real
              if ($filePath = $this->path($name)) {
                  $this->move($file, $filePath);
              }
          }
  
          $this->resetQueue('write');
  
          // Update the state of the queued attachment
          $this->updateQueueState(self::QUEUE_DONE);
      }
code: protected function flushWrites()
      {
          // Skip this if there is no queued write items
          if (count($this->getQueue('write')) === 0) {
              return;
          }
  
          // Update the state of the queued attachment
          $this->updateQueueState(self::QUEUE_WORKING);
  
          foreach ($this->getQueue('write') as $name => $style) {
              if ($style && $this->uploaded_file->isImage()) {
                  $file = $this->getResizer()
                      ->resize($this->uploaded_file, $style);
              }
              else {
                  $file = $this->uploaded_file->getRealPath();
              }
  
              // Only move it real
              if ($filePath = $this->path($name)) {
                  $this->move($file, $filePath);
              }
          }
  
          $this->resetQueue('write');
  
          // Update the state of the queued attachment
          $this->updateQueueState(self::QUEUE_DONE);
      }
code_tokens: protected function flushWrites ( ) { // Skip this if there is no queued write items if ( count ( $ this -> getQueue ( 'write' ) ) === 0 ) { return ; } // Update the state of the queued attachment $ this -> updateQueueState ( self :: QUEUE_WORKING ) ; foreach ( $ this -> getQueue ( 'write' ) as $ name => $ style ) { if ( $ style && $ this -> uploaded_file -> isImage ( ) ) { $ file = $ this -> getResizer ( ) -> resize ( $ this -> uploaded_file , $ style ) ; } else { $ file = $ this -> uploaded_file -> getRealPath ( ) ; } // Only move it real if ( $ filePath = $ this -> path ( $ name ) ) { $ this -> move ( $ file , $ filePath ) ; } } $ this -> resetQueue ( 'write' ) ; // Update the state of the queued attachment $ this -> updateQueueState ( self :: QUEUE_DONE ) ; }
docstring: Process the queued for writes.
  
  @return void
docstring_tokens: Process the queued for writes .