original_string: public function deleteFolderRecursively($folderPath)
      {
          $this->throwIfOperationNotInBaseFolder($folderPath);
  
          $itemIterator = new \RecursiveIteratorIterator(
              new \RecursiveDirectoryIterator($folderPath, \RecursiveDirectoryIterator::SKIP_DOTS),
              \RecursiveIteratorIterator::CHILD_FIRST
          );
  
          foreach ($itemIterator as $item) {
              if ($item->isDir()) {
                  rmdir($item->getPathname());
              } else {
                  unlink($item->getPathname());
              }
          }
  
          rmdir($folderPath);
      }
code: public function deleteFolderRecursively($folderPath)
      {
          $this->throwIfOperationNotInBaseFolder($folderPath);
  
          $itemIterator = new \RecursiveIteratorIterator(
              new \RecursiveDirectoryIterator($folderPath, \RecursiveDirectoryIterator::SKIP_DOTS),
              \RecursiveIteratorIterator::CHILD_FIRST
          );
  
          foreach ($itemIterator as $item) {
              if ($item->isDir()) {
                  rmdir($item->getPathname());
              } else {
                  unlink($item->getPathname());
              }
          }
  
          rmdir($folderPath);
      }
code_tokens: public function deleteFolderRecursively ( $ folderPath ) { $ this -> throwIfOperationNotInBaseFolder ( $ folderPath ) ; $ itemIterator = new \ RecursiveIteratorIterator ( new \ RecursiveDirectoryIterator ( $ folderPath , \ RecursiveDirectoryIterator :: SKIP_DOTS ) , \ RecursiveIteratorIterator :: CHILD_FIRST ) ; foreach ( $ itemIterator as $ item ) { if ( $ item -> isDir ( ) ) { rmdir ( $ item -> getPathname ( ) ) ; } else { unlink ( $ item -> getPathname ( ) ) ; } } rmdir ( $ folderPath ) ; }
docstring: Delete the folder at the given path as well as all its contents
  
  @param string $folderPath Path of the folder to delete
  @return void
  @throws \Box\Spout\Common\Exception\IOException If the folder path is not inside of the base folder
docstring_tokens: Delete the folder at the given path as well as all its contents