Skip to content

Minor project tidy for stray WordPressData files #24629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,3 @@ private func makeTags(from tags: String) -> [String] {
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }
.filter { !$0.isEmpty }
}

public extension RemotePostUpdateParameters {

var isEmpty: Bool {
self == RemotePostUpdateParameters()
}

/// Returns a diff between the original and the latest revision with the
/// changes applied on top.
static func changes(from original: AbstractPost, to latest: AbstractPost, with changes: RemotePostUpdateParameters? = nil) -> RemotePostUpdateParameters {
guard original !== latest else {
return changes ?? RemotePostUpdateParameters()
}
let parametersOriginal = RemotePostCreateParameters(post: original)
var parametersLatest = RemotePostCreateParameters(post: latest)
if let changes {
parametersLatest.apply(changes)
}
return parametersLatest.changes(from: parametersOriginal)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import WordPressKit

public extension RemotePostUpdateParameters {

var isEmpty: Bool {
self == RemotePostUpdateParameters()
}

/// Returns a diff between the original and the latest revision with the
/// changes applied on top.
static func changes(from original: AbstractPost, to latest: AbstractPost, with changes: RemotePostUpdateParameters? = nil) -> RemotePostUpdateParameters {
guard original !== latest else {
return changes ?? RemotePostUpdateParameters()
}
let parametersOriginal = RemotePostCreateParameters(post: original)
var parametersLatest = RemotePostCreateParameters(post: latest)
if let changes {
parametersLatest.apply(changes)
}
return parametersLatest.changes(from: parametersOriginal)
}
}
31 changes: 0 additions & 31 deletions WordPress/WordPress.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,6 @@
0C5C46F42D98343300F2CD55 /* Exceptions for "Classes" folder in "Keystone" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
"Services/PostRepository+Helpers.swift",
"System/ApiCredentials+BuildSecrets.swift",
System/main.swift,
"System/WordPress-Bridging-Header.h",
Expand Down Expand Up @@ -1156,33 +1155,6 @@
);
target = E16AB92914D978240047A2E5 /* WordPressTest */;
};
3F0F25872D9BD88C00CD05D6 /* Exceptions for "Classes" folder in "WordPressData" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
"Networking/WordPressOrgRestApi+WordPress.swift",
"RemotePost+Metadata.swift",
"Services/PostRepository+Helpers.swift",
);
target = 3F7AE0B42D9B30A100AB4892 /* WordPressData */;
};
3F164FCF2D9E49A8008BC606 /* Exceptions for "Classes" folder in "WordPress" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
"Networking/WordPressOrgRestApi+WordPress.swift",
"RemotePost+Metadata.swift",
"Services/PostRepository+Helpers.swift",
);
target = 1D6058900D05DD3D006BFB54 /* WordPress */;
};
3F164FD02D9E49A8008BC606 /* Exceptions for "Classes" folder in "Jetpack" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
"Networking/WordPressOrgRestApi+WordPress.swift",
"RemotePost+Metadata.swift",
"Services/PostRepository+Helpers.swift",
);
target = FABB1F8F2602FC2C00C8785C /* Jetpack */;
};
3F1A64F82DA7ABC300786B92 /* Exceptions for "Classes" folder in "Reader" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
Expand Down Expand Up @@ -1366,19 +1338,16 @@
24CE57C42CD3375200C7B37D /* Classes */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
3F164FCF2D9E49A8008BC606 /* Exceptions for "Classes" folder in "WordPress" target */,
4AC9F8152DE528180095EA51 /* Exceptions for "Classes" folder in "WordPressShareExtension" target */,
4ABC59762DE52AA2005A6B84 /* Exceptions for "Classes" folder in "WordPressDraftActionExtension" target */,
4ABCAB382DE5333C005A6B84 /* Exceptions for "Classes" folder in "WordPressNotificationServiceExtension" target */,
3F164FD02D9E49A8008BC606 /* Exceptions for "Classes" folder in "Jetpack" target */,
4ABC59822DE52D2A005A6B84 /* Exceptions for "Classes" folder in "JetpackShareExtension" target */,
4ABC59802DE52D23005A6B84 /* Exceptions for "Classes" folder in "JetpackDraftActionExtension" target */,
4ABCAB302DE5309F005A6B84 /* Exceptions for "Classes" folder in "JetpackNotificationServiceExtension" target */,
4AC9CF442DE5228C0095EA51 /* Exceptions for "Classes" folder in "JetpackStatsWidgets" target */,
4ABCAB352DE531B6005A6B84 /* Exceptions for "Classes" folder in "JetpackIntents" target */,
3F1A64F82DA7ABC300786B92 /* Exceptions for "Classes" folder in "Reader" target */,
0C5C46F42D98343300F2CD55 /* Exceptions for "Classes" folder in "Keystone" target */,
3F0F25872D9BD88C00CD05D6 /* Exceptions for "Classes" folder in "WordPressData" target */,
);
path = Classes;
sourceTree = "<group>";
Expand Down