Skip to content

Commit 6fc47db

Browse files
author
Ben Chatelain
committed
GTFilter nullability
1 parent 4e77003 commit 6fc47db

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

ObjectiveGit/GTFilter.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ extern NSString * const GTFilterErrorDomain;
1717
/// A filter with that name has already been registered.
1818
extern const NSInteger GTFilterErrorNameAlreadyRegistered;
1919

20+
NS_ASSUME_NONNULL_BEGIN
21+
2022
/// Git filter abstraction.
2123
///
2224
/// **Note**: GTFilter is *not* thread safe. Registration and unregistration
@@ -45,15 +47,17 @@ extern const NSInteger GTFilterErrorNameAlreadyRegistered;
4547
/// applyBlock - The block to use to apply the filter. Cannot be nil.
4648
///
4749
/// Returns the initialized object.
48-
- (id)initWithName:(NSString *)name attributes:(NSString *)attributes applyBlock:(NSData * (^)(void **payload, NSData *from, GTFilterSource *source, BOOL *applied))applyBlock NS_DESIGNATED_INITIALIZER;
50+
- (nullable instancetype)initWithName:(NSString *)name attributes:(nullable NSString *)attributes applyBlock:(NSData * (^)(void **payload, NSData *from, GTFilterSource *source, BOOL *applied))applyBlock NS_DESIGNATED_INITIALIZER;
4951

5052
/// Look up a filter based on its name.
5153
///
5254
/// Note that this will only find filters registered through
5355
/// -registerWithName:priority:error:.
5456
///
57+
/// name - The name of the filter to retrieve. Must not be nil.
58+
///
5559
/// Returns the filter, or nil if none was found.
56-
+ (GTFilter *)filterForName:(NSString *)name;
60+
+ (nullable GTFilter *)filterForName:(NSString *)name;
5761

5862
/// Registers the filter with the given priority.
5963
///
@@ -73,3 +77,5 @@ extern const NSInteger GTFilterErrorNameAlreadyRegistered;
7377
- (BOOL)unregister:(NSError **)error;
7478

7579
@end
80+
81+
NS_ASSUME_NONNULL_END

ObjectiveGit/GTFilter.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ + (void)initialize {
4242
GTFiltersGitFilterToRegisteredFilters = [[NSMutableDictionary alloc] init];
4343
}
4444

45-
- (id)initWithName:(NSString *)name attributes:(NSString *)attributes applyBlock:(NSData * (^)(void **payload, NSData *from, GTFilterSource *source, BOOL *applied))applyBlock {
45+
- (instancetype)initWithName:(NSString *)name attributes:(NSString *)attributes applyBlock:(NSData * (^)(void **payload, NSData *from, GTFilterSource *source, BOOL *applied))applyBlock {
4646
NSParameterAssert(name != nil);
4747
NSParameterAssert(applyBlock != NULL);
4848

0 commit comments

Comments
 (0)