original_string: protected function cleanup()
      {
          if (is_dir($this->dir)) {
              // Recursively delete all files and folders.
              $files = new \RecursiveIteratorIterator(
                  new \RecursiveDirectoryIterator($this->dir, \RecursiveDirectoryIterator::SKIP_DOTS),
                  \RecursiveIteratorIterator::CHILD_FIRST
              );
  
              foreach ($files as $fileinfo) {
                  if ($fileinfo->isDir()) {
                      rmdir($fileinfo->getRealPath());
                  } else {
                      unlink($fileinfo->getRealPath());
                  }
              }
              rmdir($this->dir);
              unset($this->git);
          }
      }
code: protected function cleanup()
      {
          if (is_dir($this->dir)) {
              // Recursively delete all files and folders.
              $files = new \RecursiveIteratorIterator(
                  new \RecursiveDirectoryIterator($this->dir, \RecursiveDirectoryIterator::SKIP_DOTS),
                  \RecursiveIteratorIterator::CHILD_FIRST
              );
  
              foreach ($files as $fileinfo) {
                  if ($fileinfo->isDir()) {
                      rmdir($fileinfo->getRealPath());
                  } else {
                      unlink($fileinfo->getRealPath());
                  }
              }
              rmdir($this->dir);
              unset($this->git);
          }
      }
code_tokens: protected function cleanup ( ) { if ( is_dir ( $ this -> dir ) ) { // Recursively delete all files and folders. $ files = new \ RecursiveIteratorIterator ( new \ RecursiveDirectoryIterator ( $ this -> dir , \ RecursiveDirectoryIterator :: SKIP_DOTS ) , \ RecursiveIteratorIterator :: CHILD_FIRST ) ; foreach ( $ files as $ fileinfo ) { if ( $ fileinfo -> isDir ( ) ) { rmdir ( $ fileinfo -> getRealPath ( ) ) ; } else { unlink ( $ fileinfo -> getRealPath ( ) ) ; } } rmdir ( $ this -> dir ) ; unset ( $ this -> git ) ; } }
docstring: Clean the temporary directory used for merging.
docstring_tokens: Clean the temporary directory used for merging .