getContentHash(); } if ($new !== null) { $new_hash = $new->getContentHash(); } $old_content = ''; $new_content = ''; if ($old_hash === $new_hash) { return null; } if ($old_hash !== self::EMPTY_HASH) { $old_content = $old->loadFileData(); } else { $old_content = ''; } if ($new_hash !== self::EMPTY_HASH) { $new_content = $new->loadFileData(); } else { $new_content = ''; } $dmp = new diff_match_patch(); $dmp_patches = $dmp->patch_make($old_content, $new_content); return $dmp->patch_toText($dmp_patches); } }