Skip to content

Commit b1993c9

Browse files
authored
refactor: user Swift convention for parameter names (#321)
* refactor: user Swift convention for parameter names * update * more updates * Update CHANGELOG.md
1 parent 22be4df commit b1993c9

19 files changed

+299
-296
lines changed

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### main
44

5-
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/4.0.0...main)
5+
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/3.1.2...main)
66
* _Contributing to this repo? Add info about your change here to be included in the next release_
77

88
### 4.0.0
@@ -18,6 +18,9 @@ __New features__
1818
define a ParseObject. Look at the PR for
1919
details on why this is important when using the SDK ([#315](https://github.com/parse-community/Parse-Swift/pull/315)), thanks to [Corey Baker](https://github.com/cbaker6).
2020

21+
__Improvements__
22+
- (Breaking Change) Change the following method parameter names: isUsingMongoDB -> usingMongoDB, isIgnoreCustomObjectIdConfig -> ignoringCustomObjectIdConfig, isUsingEQ -> usingEqComparator ([#321](https://github.com/parse-community/Parse-Swift/pull/321)), thanks to [Corey Baker](https://github.com/cbaker6).
23+
2124
### 3.1.2
2225
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/3.1.1...3.1.2)
2326

@@ -35,7 +38,7 @@ __Fixes__
3538
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/3.0.0...3.1.0)
3639

3740
__New features__
38-
- Add the ability to explain MongoDB queries by setting isUsingMongoDB = true for the respective explain query ([#314](https://github.com/parse-community/Parse-Swift/pull/314)), thanks to [Corey Baker](https://github.com/cbaker6).
41+
- Add the ability to explain MongoDB queries by setting usingMongoDB = true for the respective explain query ([#314](https://github.com/parse-community/Parse-Swift/pull/314)), thanks to [Corey Baker](https://github.com/cbaker6).
3942

4043
### 3.0.0
4144
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/2.5.1...3.0.0)
@@ -244,7 +247,7 @@ __Fixes__
244247
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.9.6...1.9.7)
245248

246249
__Improvements__
247-
- Properly allow a mixed custom objectId environment without compromising safety checks using .save(). If a developer wants to ignore the objectId checks, they need to specify isIgnoreCustomObjectIdConfig = true each time ([#222](https://github.com/parse-community/Parse-Swift/pull/222)), thanks to [Corey Baker](https://github.com/cbaker6).
250+
- Properly allow a mixed custom objectId environment without compromising safety checks using .save(). If a developer wants to ignore the objectId checks, they need to specify ignoringCustomObjectIdConfig = true each time ([#222](https://github.com/parse-community/Parse-Swift/pull/222)), thanks to [Corey Baker](https://github.com/cbaker6).
248251

249252
### 1.9.6
250253
[Full Changelog](https://github.com/parse-community/Parse-Swift/compare/1.9.5...1.9.6)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import PackageDescription
5757
let package = Package(
5858
name: "YOUR_PROJECT_NAME",
5959
dependencies: [
60-
.package(url: "https://github.com/parse-community/Parse-Swift", from: "4.0.0"),
60+
.package(url: "https://github.com/parse-community/Parse-Swift", from: "3.1.2"),
6161
]
6262
)
6363
```

Sources/ParseSwift/API/API+Command.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,9 @@ internal extension API.Command {
386386
// MARK: Saving ParseObjects
387387
static func save<T>(_ object: T,
388388
original data: Data?,
389-
isIgnoreCustomObjectIdConfig: Bool) throws -> API.Command<T, T> where T: ParseObject {
389+
ignoringCustomObjectIdConfig: Bool) throws -> API.Command<T, T> where T: ParseObject {
390390
if ParseSwift.configuration.isAllowingCustomObjectIds
391-
&& object.objectId == nil && !isIgnoreCustomObjectIdConfig {
391+
&& object.objectId == nil && !ignoringCustomObjectIdConfig {
392392
throw ParseError(code: .missingObjectId, message: "objectId must not be nil")
393393
}
394394
if object.isSaved {

Sources/ParseSwift/Objects/ParseInstallation+async.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public extension ParseInstallation {
3636

3737
/**
3838
Saves the `ParseInstallation` *asynchronously*.
39-
- parameter isIgnoreCustomObjectIdConfig: Ignore checking for `objectId`
39+
- parameter ignoringCustomObjectIdConfig: Ignore checking for `objectId`
4040
when `ParseConfiguration.isAllowingCustomObjectIds = true` to allow for mixed
4141
`objectId` environments. Defaults to false.
4242
- parameter options: A set of header options sent to the server. Defaults to an empty set.
@@ -45,20 +45,20 @@ public extension ParseInstallation {
4545
- important: If an object saved has the same objectId as current, it will automatically update the current.
4646
- warning: If you are using `ParseConfiguration.isAllowingCustomObjectIds = true`
4747
and plan to generate all of your `objectId`'s on the client-side then you should leave
48-
`isIgnoreCustomObjectIdConfig = false`. Setting
48+
`ignoringCustomObjectIdConfig = false`. Setting
4949
`ParseConfiguration.isAllowingCustomObjectIds = true` and
50-
`isIgnoreCustomObjectIdConfig = true` means the client will generate `objectId`'s
50+
`ignoringCustomObjectIdConfig = true` means the client will generate `objectId`'s
5151
and the server will generate an `objectId` only when the client does not provide one. This can
5252
increase the probability of colliiding `objectId`'s as the client and server `objectId`'s may be generated using
5353
different algorithms. This can also lead to overwriting of `ParseObject`'s by accident as the
5454
client-side checks are disabled. Developers are responsible for handling such cases.
5555
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
5656
desires a different policy, it should be inserted in `options`.
5757
*/
58-
func save(isIgnoreCustomObjectIdConfig: Bool = false,
58+
func save(ignoringCustomObjectIdConfig: Bool = false,
5959
options: API.Options = []) async throws -> Self {
6060
try await withCheckedThrowingContinuation { continuation in
61-
self.save(isIgnoreCustomObjectIdConfig: isIgnoreCustomObjectIdConfig,
61+
self.save(ignoringCustomObjectIdConfig: ignoringCustomObjectIdConfig,
6262
options: options,
6363
completion: continuation.resume)
6464
}
@@ -149,7 +149,7 @@ public extension Sequence where Element: ParseInstallation {
149149
Defaults to 50.
150150
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
151151
prevents the transaction from completing, then none of the objects are committed to the Parse Server database.
152-
- parameter isIgnoreCustomObjectIdConfig: Ignore checking for `objectId`
152+
- parameter ignoringCustomObjectIdConfig: Ignore checking for `objectId`
153153
when `ParseConfiguration.isAllowingCustomObjectIds = true` to allow for mixed
154154
`objectId` environments. Defaults to false.
155155
- parameter options: A set of header options sent to the server. Defaults to an empty set.
@@ -162,9 +162,9 @@ public extension Sequence where Element: ParseInstallation {
162162
the transactions can fail.
163163
- warning: If you are using `ParseConfiguration.isAllowingCustomObjectIds = true`
164164
and plan to generate all of your `objectId`'s on the client-side then you should leave
165-
`isIgnoreCustomObjectIdConfig = false`. Setting
165+
`ignoringCustomObjectIdConfig = false`. Setting
166166
`ParseConfiguration.isAllowingCustomObjectIds = true` and
167-
`isIgnoreCustomObjectIdConfig = true` means the client will generate `objectId`'s
167+
`ignoringCustomObjectIdConfig = true` means the client will generate `objectId`'s
168168
and the server will generate an `objectId` only when the client does not provide one. This can
169169
increase the probability of colliiding `objectId`'s as the client and server `objectId`'s may be generated using
170170
different algorithms. This can also lead to overwriting of `ParseObject`'s by accident as the
@@ -174,12 +174,12 @@ public extension Sequence where Element: ParseInstallation {
174174
*/
175175
func saveAll(batchLimit limit: Int? = nil,
176176
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
177-
isIgnoreCustomObjectIdConfig: Bool = false,
177+
ignoringCustomObjectIdConfig: Bool = false,
178178
options: API.Options = []) async throws -> [(Result<Self.Element, ParseError>)] {
179179
try await withCheckedThrowingContinuation { continuation in
180180
self.saveAll(batchLimit: limit,
181181
transaction: transaction,
182-
isIgnoreCustomObjectIdConfig: isIgnoreCustomObjectIdConfig,
182+
ignoringCustomObjectIdConfig: ignoringCustomObjectIdConfig,
183183
options: options,
184184
completion: continuation.resume)
185185
}

Sources/ParseSwift/Objects/ParseInstallation+combine.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,28 @@ public extension ParseInstallation {
3737
/**
3838
Saves the `ParseInstallation` *asynchronously* and publishes when complete.
3939

40-
- parameter isIgnoreCustomObjectIdConfig: Ignore checking for `objectId`
40+
- parameter ignoringCustomObjectIdConfig: Ignore checking for `objectId`
4141
when `ParseConfiguration.isAllowingCustomObjectIds = true` to allow for mixed
4242
`objectId` environments. Defaults to false.
4343
- parameter options: A set of header options sent to the server. Defaults to an empty set.
4444
- returns: A publisher that eventually produces a single value and then finishes or fails.
4545
- important: If an object saved has the same objectId as current, it will automatically update the current.
4646
- warning: If you are using `ParseConfiguration.isAllowingCustomObjectIds = true`
4747
and plan to generate all of your `objectId`'s on the client-side then you should leave
48-
`isIgnoreCustomObjectIdConfig = false`. Setting
48+
`ignoringCustomObjectIdConfig = false`. Setting
4949
`ParseConfiguration.isAllowingCustomObjectIds = true` and
50-
`isIgnoreCustomObjectIdConfig = true` means the client will generate `objectId`'s
50+
`ignoringCustomObjectIdConfig = true` means the client will generate `objectId`'s
5151
and the server will generate an `objectId` only when the client does not provide one. This can
5252
increase the probability of colliiding `objectId`'s as the client and server `objectId`'s may be generated using
5353
different algorithms. This can also lead to overwriting of `ParseObject`'s by accident as the
5454
client-side checks are disabled. Developers are responsible for handling such cases.
5555
- note: The default cache policy for this method is `.reloadIgnoringLocalCacheData`. If a developer
5656
desires a different policy, it should be inserted in `options`.
5757
*/
58-
func savePublisher(isIgnoreCustomObjectIdConfig: Bool = false,
58+
func savePublisher(ignoringCustomObjectIdConfig: Bool = false,
5959
options: API.Options = []) -> Future<Self, ParseError> {
6060
Future { promise in
61-
self.save(isIgnoreCustomObjectIdConfig: isIgnoreCustomObjectIdConfig,
61+
self.save(ignoringCustomObjectIdConfig: ignoringCustomObjectIdConfig,
6262
options: options,
6363
completion: promise)
6464
}
@@ -147,7 +147,7 @@ public extension Sequence where Element: ParseInstallation {
147147
Defaults to 50.
148148
- parameter transaction: Treat as an all-or-nothing operation. If some operation failure occurs that
149149
prevents the transaction from completing, then none of the objects are committed to the Parse Server database.
150-
- parameter isIgnoreCustomObjectIdConfig: Ignore checking for `objectId`
150+
- parameter ignoringCustomObjectIdConfig: Ignore checking for `objectId`
151151
when `ParseConfiguration.isAllowingCustomObjectIds = true` to allow for mixed
152152
`objectId` environments. Defaults to false.
153153
- parameter options: A set of header options sent to the server. Defaults to an empty set.
@@ -159,9 +159,9 @@ public extension Sequence where Element: ParseInstallation {
159159
the transactions can fail.
160160
- warning: If you are using `ParseConfiguration.isAllowingCustomObjectIds = true`
161161
and plan to generate all of your `objectId`'s on the client-side then you should leave
162-
`isIgnoreCustomObjectIdConfig = false`. Setting
162+
`ignoringCustomObjectIdConfig = false`. Setting
163163
`ParseConfiguration.isAllowingCustomObjectIds = true` and
164-
`isIgnoreCustomObjectIdConfig = true` means the client will generate `objectId`'s
164+
`ignoringCustomObjectIdConfig = true` means the client will generate `objectId`'s
165165
and the server will generate an `objectId` only when the client does not provide one. This can
166166
increase the probability of colliiding `objectId`'s as the client and server `objectId`'s may be generated using
167167
different algorithms. This can also lead to overwriting of `ParseObject`'s by accident as the
@@ -171,12 +171,12 @@ public extension Sequence where Element: ParseInstallation {
171171
*/
172172
func saveAllPublisher(batchLimit limit: Int? = nil,
173173
transaction: Bool = ParseSwift.configuration.isUsingTransactions,
174-
isIgnoreCustomObjectIdConfig: Bool = false,
174+
ignoringCustomObjectIdConfig: Bool = false,
175175
options: API.Options = []) -> Future<[(Result<Self.Element, ParseError>)], ParseError> {
176176
Future { promise in
177177
self.saveAll(batchLimit: limit,
178178
transaction: transaction,
179-
isIgnoreCustomObjectIdConfig: isIgnoreCustomObjectIdConfig,
179+
ignoringCustomObjectIdConfig: ignoringCustomObjectIdConfig,
180180
options: options,
181181
completion: promise)
182182
}

0 commit comments

Comments
 (0)