-
Notifications
You must be signed in to change notification settings - Fork 31
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
Changed for Swift 3 compliance #50
base: master
Are you sure you want to change the base?
Conversation
@@ -56,44 +56,54 @@ public class Serializable: NSObject { | |||
|
|||
- returns: The class as an NSDictionary. | |||
*/ | |||
public func toDictionary() -> NSDictionary { | |||
open func toDictionary() -> NSDictionary { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cyclomatic Complexity Violation: Function should have complexity 10 or less: currently complexity equals 17 (cyclomatic_complexity)
} | ||
else if let propValue:UInt32 = propValue as? UInt32 { | ||
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt32), forKey: propName!) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Statement Position Violation: Else and catch should be on the same line, one space after the previous declaration. (statement_position)
} | ||
else if let propValue:UInt16 = propValue as? UInt16 { | ||
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt16), forKey: propName!) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Statement Position Violation: Else and catch should be on the same line, one space after the previous declaration. (statement_position)
} | ||
else if let propValue:UInt8 = propValue as? UInt8 { | ||
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt8), forKey: propName!) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Statement Position Violation: Else and catch should be on the same line, one space after the previous declaration. (statement_position)
} | ||
else if let propValue:Int64 = propValue as? Int64 { | ||
setValue(propertiesDictionary, value: NSNumber(value: propValue as Int64), forKey: propName!) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Statement Position Violation: Else and catch should be on the same line, one space after the previous declaration. (statement_position)
var dictionary = [String: AnyObject]() | ||
open class Serializable: NSObject { | ||
fileprivate class SortedDictionary : NSMutableDictionary { | ||
var _dictionary = [String: AnyObject]() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable Name Violation: Variable name should only contain alphanumeric characters: '_dictionary' (variable_name)
@@ -125,9 +135,9 @@ public class Serializable: NSObject { | |||
|
|||
- returns: The class as a JSON string. | |||
*/ | |||
public func toJsonString(prettyPrinted: Bool = false) -> String? { | |||
open func toJsonString(_ prettyPrinted : Bool = false) -> String? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Colon Violation: Colons should be next to the identifier when specifying a type. (colon)
@@ -105,12 +115,12 @@ public class Serializable: NSObject { | |||
|
|||
- returns: The class as JSON, wrapped in NSData. | |||
*/ | |||
public func toJson(prettyPrinted: Bool = false) -> NSData? { | |||
open func toJson(_ prettyPrinted : Bool = false) -> Data? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Colon Violation: Colons should be next to the identifier when specifying a type. (colon)
else if let propValue:UInt32 = propValue as? UInt32 { | ||
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt32), forKey: propName!) | ||
} | ||
else if let propValue:UInt64 = propValue as? UInt64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Colon Violation: Colons should be next to the identifier when specifying a type. (colon)
else if let propValue:UInt16 = propValue as? UInt16 { | ||
setValue(propertiesDictionary, value: NSNumber(value: propValue as UInt16), forKey: propName!) | ||
} | ||
else if let propValue:UInt32 = propValue as? UInt32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Colon Violation: Colons should be next to the identifier when specifying a type. (colon)
Have not done a lot of checks but is mostly syntaxic changes.