Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Qandelor
Copy link

Have not done a lot of checks but is mostly syntaxic changes.

@@ -56,44 +56,54 @@ public class Serializable: NSObject {

- returns: The class as an NSDictionary.
*/
public func toDictionary() -> NSDictionary {
open func toDictionary() -> NSDictionary {

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!)
}

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!)
}

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!)
}

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!)
}

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]()

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? {

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? {

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 {

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 {

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants