Skip to content

Commit c71cfd3

Browse files
committed
Cleaned up some warnings from the static analyzer
1 parent 8d38b5f commit c71cfd3

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

Parse/PFObject.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
491491
492492
@deprecated Please use `-fetch` instead.
493493
*/
494-
- (void)refresh PARSE_DEPRECATED("Please use `-fetch` instead.");
494+
- (instancetype)refresh PARSE_DEPRECATED("Please use `-fetch` instead.");
495495

496496
/*!
497497
@abstract *Synchronously* refreshes the `PFObject` with the current data from the server and sets an error if it occurs.
@@ -500,7 +500,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
500500
501501
@deprecated Please use `-fetch:` instead.
502502
*/
503-
- (void)refresh:(NSError **)error PARSE_DEPRECATED("Please use `-fetch:` instead.");
503+
- (instancetype)refresh:(NSError **)error PARSE_DEPRECATED("Please use `-fetch:` instead.");
504504

505505
/*!
506506
@abstract *Asynchronously* refreshes the `PFObject` and executes the given callback block.
@@ -531,13 +531,13 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
531531
/*!
532532
@abstract *Synchronously* fetches the PFObject with the current data from the server.
533533
*/
534-
- (void)fetch;
534+
- (instancetype)fetch;
535535
/*!
536536
@abstract *Synchronously* fetches the PFObject with the current data from the server and sets an error if it occurs.
537537
538538
@param error Pointer to an `NSError` that will be set if necessary.
539539
*/
540-
- (void)fetch:(NSError **)error;
540+
- (instancetype)fetch:(NSError **)error;
541541

542542
/*!
543543
@abstract *Synchronously* fetches the `PFObject` data from the server if <isDataAvailable> is `NO`.
@@ -614,7 +614,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
614614
615615
@param objects The list of objects to fetch.
616616
*/
617-
+ (void)fetchAll:(PF_NULLABLE NSArray *)objects;
617+
+ (instancetype)fetchAll:(PF_NULLABLE NSArray *)objects;
618618

619619
/*!
620620
@abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server
@@ -623,13 +623,13 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
623623
@param objects The list of objects to fetch.
624624
@param error Pointer to an `NSError` that will be set if necessary.
625625
*/
626-
+ (void)fetchAll:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
626+
+ (instancetype)fetchAll:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
627627

628628
/*!
629629
@abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server.
630630
@param objects The list of objects to fetch.
631631
*/
632-
+ (void)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects;
632+
+ (instancetype)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects;
633633

634634
/*!
635635
@abstract *Synchronously* fetches all of the `PFObject` objects with the current data from the server
@@ -638,7 +638,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
638638
@param objects The list of objects to fetch.
639639
@param error Pointer to an `NSError` that will be set if necessary.
640640
*/
641-
+ (void)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
641+
+ (instancetype)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects error:(NSError **)error;
642642

643643
/*!
644644
@abstract Fetches all of the `PFObject` objects with the current data from the server *asynchronously*.
@@ -718,7 +718,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
718718
@abstract *Synchronously* loads data from the local datastore into this object,
719719
if it has not been fetched from the server already.
720720
*/
721-
- (void)fetchFromLocalDatastore;
721+
- (instancetype)fetchFromLocalDatastore;
722722

723723
/*!
724724
@abstract *Synchronously* loads data from the local datastore into this object, if it has not been fetched
@@ -729,7 +729,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS
729729
730730
@param error Pointer to an `NSError` that will be set if necessary.
731731
*/
732-
- (void)fetchFromLocalDatastore:(NSError **)error;
732+
- (instancetype)fetchFromLocalDatastore:(NSError **)error;
733733

734734
/*!
735735
@abstract *Asynchronously* loads data from the local datastore into this object,

Parse/PFObject.m

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ - (void)mergeFromRESTDictionary:(NSDictionary *)object withDecoder:(PFDecoder *)
11101110
if (localOperationSet.updatedAt != nil &&
11111111
[localOperationSet.updatedAt compare:remoteOperationSet.updatedAt] != NSOrderedAscending) {
11121112
[localOperationSet mergeOperationSet:remoteOperationSet];
1113-
} else {
1113+
} else if (remoteOperationSet) {
11141114
NSUInteger index = [operationSetQueue indexOfObject:localOperationSet];
11151115
[remoteOperationSet mergeOperationSet:localOperationSet];
11161116
[operationSetQueue replaceObjectAtIndex:index withObject:remoteOperationSet];
@@ -2102,12 +2102,12 @@ - (BOOL)isDataAvailable {
21022102
return self._state.complete;
21032103
}
21042104

2105-
- (void)refresh {
2106-
[self fetch];
2105+
- (instancetype)refresh {
2106+
return [self fetch];
21072107
}
21082108

2109-
- (void)refresh:(NSError **)error {
2110-
[self fetch:error];
2109+
- (instancetype)refresh:(NSError **)error {
2110+
return [self fetch:error];
21112111
}
21122112

21132113
- (void)refreshInBackgroundWithTarget:(id)target selector:(SEL)selector {
@@ -2118,12 +2118,12 @@ - (void)refreshInBackgroundWithBlock:(PFObjectResultBlock)block {
21182118
[self fetchInBackgroundWithBlock:block];
21192119
}
21202120

2121-
- (void)fetch {
2122-
[self fetch:nil];
2121+
- (instancetype)fetch {
2122+
return [self fetch:nil];
21232123
}
21242124

2125-
- (void)fetch:(NSError **)error {
2126-
[[self fetchInBackground] waitForResult:error];
2125+
- (instancetype)fetch:(NSError **)error {
2126+
return [[self fetchInBackground] waitForResult:error];
21272127
}
21282128

21292129
- (BFTask *)fetchInBackground {
@@ -2175,20 +2175,20 @@ - (void)fetchIfNeededInBackgroundWithTarget:(id)target selector:(SEL)selector {
21752175
#pragma mark - Fetching Many Objects
21762176
///--------------------------------------
21772177

2178-
+ (void)fetchAll:(NSArray *)objects {
2179-
[PFObject fetchAll:objects error:nil];
2178+
+ (instancetype)fetchAll:(NSArray *)objects {
2179+
return [PFObject fetchAll:objects error:nil];
21802180
}
21812181

2182-
+ (void)fetchAllIfNeeded:(NSArray *)objects {
2183-
[PFObject fetchAllIfNeeded:objects error:nil];
2182+
+ (instancetype)fetchAllIfNeeded:(NSArray *)objects {
2183+
return [PFObject fetchAllIfNeeded:objects error:nil];
21842184
}
21852185

2186-
+ (void)fetchAll:(NSArray *)objects error:(NSError **)error {
2187-
[[self fetchAllInBackground:objects] waitForResult:error];
2186+
+ (instancetype)fetchAll:(NSArray *)objects error:(NSError **)error {
2187+
return [[self fetchAllInBackground:objects] waitForResult:error];
21882188
}
21892189

2190-
+ (void)fetchAllIfNeeded:(NSArray *)objects error:(NSError **)error {
2191-
[[self fetchAllIfNeededInBackground:objects] waitForResult:error];
2190+
+ (instancetype)fetchAllIfNeeded:(NSArray *)objects error:(NSError **)error {
2191+
return [[self fetchAllIfNeededInBackground:objects] waitForResult:error];
21922192
}
21932193

21942194
+ (BFTask *)fetchAllInBackground:(NSArray *)objects {
@@ -2249,12 +2249,12 @@ + (void)fetchAllIfNeededInBackground:(NSArray *)objects block:(PFArrayResultBloc
22492249
#pragma mark - Fetch From Local Datastore
22502250
///--------------------------------------
22512251

2252-
- (void)fetchFromLocalDatastore {
2253-
[self fetchFromLocalDatastore:nil];
2252+
- (instancetype)fetchFromLocalDatastore {
2253+
return [self fetchFromLocalDatastore:nil];
22542254
}
22552255

2256-
- (void)fetchFromLocalDatastore:(NSError **)error {
2257-
[[self fetchFromLocalDatastoreInBackground] waitForResult:error];
2256+
- (instancetype)fetchFromLocalDatastore:(NSError **)error {
2257+
return [[self fetchFromLocalDatastoreInBackground] waitForResult:error];
22582258
}
22592259

22602260
- (void)fetchFromLocalDatastoreInBackgroundWithBlock:(PFObjectResultBlock)block {

Parse/PFUser.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,11 +1113,11 @@ - (BFTask *)fetchAsync:(BFTask *)toAwait {
11131113
}];
11141114
}
11151115

1116-
- (void)fetch:(NSError **)error {
1116+
- (instancetype)fetch:(NSError **)error {
11171117
if (self.isLazy) {
1118-
return;
1118+
return nil;
11191119
}
1120-
[super fetch:error];
1120+
return [super fetch:error];
11211121
}
11221122

11231123
- (void)fetchInBackgroundWithBlock:(PFObjectResultBlock)block {

0 commit comments

Comments
 (0)