original_string: public static function unlinkTargetFilesNotPresentInSource($source, $target)
      {
          $diff = self::directoryDiff($source, $target);
          $diff = self::sortFilesDescByPathLength($diff);
  
          foreach ($diff as $file) {
              $remove = $target . $file;
  
              if (is_dir($remove)) {
                  @rmdir($remove);
              } else {
                  self::deleteFileIfExists($remove);
              }
          }
      }
code: public static function unlinkTargetFilesNotPresentInSource($source, $target)
      {
          $diff = self::directoryDiff($source, $target);
          $diff = self::sortFilesDescByPathLength($diff);
  
          foreach ($diff as $file) {
              $remove = $target . $file;
  
              if (is_dir($remove)) {
                  @rmdir($remove);
              } else {
                  self::deleteFileIfExists($remove);
              }
          }
      }
code_tokens: public static function unlinkTargetFilesNotPresentInSource ( $ source , $ target ) { $ diff = self :: directoryDiff ( $ source , $ target ) ; $ diff = self :: sortFilesDescByPathLength ( $ diff ) ; foreach ( $ diff as $ file ) { $ remove = $ target . $ file ; if ( is_dir ( $ remove ) ) { @ rmdir ( $ remove ) ; } else { self :: deleteFileIfExists ( $ remove ) ; } } }
docstring: Removes all files and directories that are present in the target directory but are not in the source directory.
  
  @param string $source Path to the source directory
  @param string $target Path to the target
docstring_tokens: Removes all files and directories that are present in the target directory but are not in the source directory .