original_string: public static function recursiveRemove($path)
      {
          if (is_dir($path)) {
              $files = scandir($path);
              foreach ($files as $file) {
                  if ($file != "." && $file != "..") {
                      self::recursiveRemove("$path/$file");
                  }
              }
              if (!rmdir($path)) {
                  throw new IOException("Cannot rmdir '$path'", 0, null, $path);
              }
          } elseif (file_exists($path)) {
              if (!unlink($path)) {
                  throw new IOException("Cannot unlink '$path'", 0, null, $path);
              }
          }
      }
code: public static function recursiveRemove($path)
      {
          if (is_dir($path)) {
              $files = scandir($path);
              foreach ($files as $file) {
                  if ($file != "." && $file != "..") {
                      self::recursiveRemove("$path/$file");
                  }
              }
              if (!rmdir($path)) {
                  throw new IOException("Cannot rmdir '$path'", 0, null, $path);
              }
          } elseif (file_exists($path)) {
              if (!unlink($path)) {
                  throw new IOException("Cannot unlink '$path'", 0, null, $path);
              }
          }
      }
code_tokens: public static function recursiveRemove ( $ path ) { if ( is_dir ( $ path ) ) { $ files = scandir ( $ path ) ; foreach ( $ files as $ file ) { if ( $ file != "." && $ file != ".." ) { self :: recursiveRemove ( "$path/$file" ) ; } } if ( ! rmdir ( $ path ) ) { throw new IOException ( "Cannot rmdir '$path'" , 0 , null , $ path ) ; } } elseif ( file_exists ( $ path ) ) { if ( ! unlink ( $ path ) ) { throw new IOException ( "Cannot unlink '$path'" , 0 , null , $ path ) ; } } }
docstring: rm -r path
docstring_tokens: rm - r path