From 8df1a1241236306a5bb67cb27fc57bcc75e21465 Mon Sep 17 00:00:00 2001 From: Henri Salminen Date: Tue, 30 Jan 2018 14:28:58 +0200 Subject: [PATCH] Fixes build warnings caused by documentation issues. --- Source/SocketIO/Ack/SocketAckEmitter.swift | 2 +- Source/SocketIO/Client/SocketIOClient.swift | 10 +++++----- Source/SocketIO/Client/SocketIOClientSpec.swift | 4 ++-- Source/SocketIO/Engine/SocketEngine.swift | 6 ++---- Source/SocketIO/Engine/SocketEngineSpec.swift | 6 ++---- Source/SocketIO/Manager/SocketManager.swift | 6 +++--- Source/SocketIO/Manager/SocketManagerSpec.swift | 6 +++--- 7 files changed, 18 insertions(+), 22 deletions(-) diff --git a/Source/SocketIO/Ack/SocketAckEmitter.swift b/Source/SocketIO/Ack/SocketAckEmitter.swift index db8cecf..449d04e 100644 --- a/Source/SocketIO/Ack/SocketAckEmitter.swift +++ b/Source/SocketIO/Ack/SocketAckEmitter.swift @@ -108,7 +108,7 @@ public final class OnAckCallback : NSObject { /// Completes an emitWithAck. If this isn't called, the emit never happens. /// - /// - parameter after: The number of seconds before this emit times out if an ack hasn't been received. + /// - parameter seconds: The number of seconds before this emit times out if an ack hasn't been received. /// - parameter callback: The callback called when an ack is received, or when a timeout happens. /// To check for timeout, use `SocketAckStatus`'s `noAck` case. @objc diff --git a/Source/SocketIO/Client/SocketIOClient.swift b/Source/SocketIO/Client/SocketIOClient.swift index 587319c..b6515e6 100644 --- a/Source/SocketIO/Client/SocketIOClient.swift +++ b/Source/SocketIO/Client/SocketIOClient.swift @@ -86,7 +86,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec { /// Type safe way to create a new SocketIOClient. `opts` can be omitted. /// /// - parameter manager: The manager for this socket. - /// - parameter socketURL: The url of the socket.io server. + /// - parameter nsp: The namespace of the socket. @objc public init(manager: SocketManagerSpec, nsp: String) { self.manager = manager @@ -115,7 +115,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec { /// /// - parameter timeoutAfter: The number of seconds after which if we are not connected we assume the connection /// has failed. Pass 0 to never timeout. - /// - parameter withHandler: The handler to call when the client fails to connect. + /// - parameter handler: The handler to call when the client fails to connect. @objc open func connect(timeoutAfter: Double, withHandler handler: (() -> ())?) { assert(timeoutAfter >= 0, "Invalid timeout: \(timeoutAfter)") @@ -213,7 +213,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec { /// Same as emit, but meant for Objective-C /// /// - parameter event: The event to send. - /// - parameter with: The items to send with this event. Send an empty array to send no data. + /// - parameter items: The items to send with this event. Send an empty array to send no data. @objc open func emit(_ event: String, with items: [Any]) { guard status == .connected else { @@ -270,7 +270,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec { /// ``` /// /// - parameter event: The event to send. - /// - parameter with: The items to send with this event. Use `[]` to send nothing. + /// - parameter items: The items to send with this event. Use `[]` to send nothing. /// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent. @objc open func emitWithAck(_ event: String, with items: [Any]) -> OnAckCallback { @@ -334,7 +334,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec { /// - parameter event: The name of the event. /// - parameter data: The data that was sent with this event. /// - parameter isInternalMessage: Whether this event was sent internally. If `true` it is always sent to handlers. - /// - parameter withAck: If > 0 then this event expects to get an ack back from the client. + /// - parameter ack: If > 0 then this event expects to get an ack back from the client. @objc open func handleEvent(_ event: String, data: [Any], isInternalMessage: Bool, withAck ack: Int = -1) { guard status == .connected || isInternalMessage else { return } diff --git a/Source/SocketIO/Client/SocketIOClientSpec.swift b/Source/SocketIO/Client/SocketIOClientSpec.swift index 26e8e60..739c7e9 100644 --- a/Source/SocketIO/Client/SocketIOClientSpec.swift +++ b/Source/SocketIO/Client/SocketIOClientSpec.swift @@ -59,7 +59,7 @@ public protocol SocketIOClientSpec : class { /// /// - parameter timeoutAfter: The number of seconds after which if we are not connected we assume the connection /// has failed. Pass 0 to never timeout. - /// - parameter withHandler: The handler to call when the client fails to connect. + /// - parameter handler: The handler to call when the client fails to connect. func connect(timeoutAfter: Double, withHandler handler: (() -> ())?) /// Called when the client connects to a namespace. If the client was created with a namespace upfront, @@ -134,7 +134,7 @@ public protocol SocketIOClientSpec : class { /// - parameter event: The name of the event. /// - parameter data: The data that was sent with this event. /// - parameter isInternalMessage: Whether this event was sent internally. If `true` it is always sent to handlers. - /// - parameter withAck: If > 0 then this event expects to get an ack back from the client. + /// - parameter ack: If > 0 then this event expects to get an ack back from the client. func handleEvent(_ event: String, data: [Any], isInternalMessage: Bool, withAck ack: Int) /// Causes a client to handle a socket.io packet. The namespace for the packet must match the namespace of the diff --git a/Source/SocketIO/Engine/SocketEngine.swift b/Source/SocketIO/Engine/SocketEngine.swift index 6b6df7a..d7253d5 100644 --- a/Source/SocketIO/Engine/SocketEngine.swift +++ b/Source/SocketIO/Engine/SocketEngine.swift @@ -461,8 +461,6 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll /// Parses a raw engine.io packet. /// /// - parameter message: The message to parse. - /// - parameter fromPolling: Whether this message is from long-polling. - /// If `true` we might have to fix utf8 encoding. public func parseEngineMessage(_ message: String) { DefaultSocketLogger.Logger.log("Got message: \(message)", type: SocketEngine.logType) @@ -586,8 +584,8 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll /// Writes a message to engine.io, independent of transport. /// /// - parameter msg: The message to send. - /// - parameter withType: The type of this message. - /// - parameter withData: Any data that this message has. + /// - parameter type: The type of this message. + /// - parameter data: Any data that this message has. public func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data]) { engineQueue.async { guard self.connected else { return } diff --git a/Source/SocketIO/Engine/SocketEngineSpec.swift b/Source/SocketIO/Engine/SocketEngineSpec.swift index 59ba6b6..fa08519 100644 --- a/Source/SocketIO/Engine/SocketEngineSpec.swift +++ b/Source/SocketIO/Engine/SocketEngineSpec.swift @@ -130,15 +130,13 @@ import Starscream /// Parses a raw engine.io packet. /// /// - parameter message: The message to parse. - /// - parameter fromPolling: Whether this message is from long-polling. - /// If `true` we might have to fix utf8 encoding. func parseEngineMessage(_ message: String) /// Writes a message to engine.io, independent of transport. /// /// - parameter msg: The message to send. - /// - parameter withType: The type of this message. - /// - parameter withData: Any data that this message has. + /// - parameter type: The type of this message. + /// - parameter data: Any data that this message has. func write(_ msg: String, withType type: SocketEnginePacketType, withData data: [Data]) } diff --git a/Source/SocketIO/Manager/SocketManager.swift b/Source/SocketIO/Manager/SocketManager.swift index 9d04d1e..e4fbf7d 100644 --- a/Source/SocketIO/Manager/SocketManager.swift +++ b/Source/SocketIO/Manager/SocketManager.swift @@ -241,7 +241,7 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa /// This will remove the socket for the manager's control, and make the socket instance useless and ready for /// releasing. /// - /// - parameter forNamespace: The namespace to disconnect from. + /// - parameter nsp: The namespace to disconnect from. open func disconnectSocket(forNamespace nsp: String) { guard let socket = nsps.removeValue(forKey: nsp) else { DefaultSocketLogger.Logger.log("Could not find socket for \(nsp) to disconnect", @@ -282,7 +282,7 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa /// Same as `emitAll(_:_:)`, but meant for Objective-C. /// /// - parameter event: The event to send. - /// - parameter withItems: The data to send with this event. + /// - parameter items: The data to send with this event. open func emitAll(_ event: String, withItems items: [Any]) { forAll {socket in socket.emit(event, with: items) @@ -508,7 +508,7 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa /// Call one of the `disconnectSocket` methods on this class to remove the socket from manager control. /// Or call `SocketIOClient.disconnect()` on the client. /// - /// - parameter forNamespace: The namespace for the socket. + /// - parameter nsp: The namespace for the socket. /// - returns: A `SocketIOClient` for the given namespace. open func socket(forNamespace nsp: String) -> SocketIOClient { assert(nsp.hasPrefix("/"), "forNamespace must have a leading /") diff --git a/Source/SocketIO/Manager/SocketManagerSpec.swift b/Source/SocketIO/Manager/SocketManagerSpec.swift index 52bdcab..79f0e98 100644 --- a/Source/SocketIO/Manager/SocketManagerSpec.swift +++ b/Source/SocketIO/Manager/SocketManagerSpec.swift @@ -103,13 +103,13 @@ public protocol SocketManagerSpec : class, SocketEngineClient { /// Disconnects the socket associated with `forNamespace`. /// - /// - parameter forNamespace: The namespace to disconnect from. + /// - parameter nsp: The namespace to disconnect from. func disconnectSocket(forNamespace nsp: String) /// Sends an event to the server on all namespaces in this manager. /// /// - parameter event: The event to send. - /// - parameter withItems: The data to send with this event. + /// - parameter items: The data to send with this event. func emitAll(_ event: String, withItems items: [Any]) /// Tries to reconnect to the server. @@ -133,7 +133,7 @@ public protocol SocketManagerSpec : class, SocketEngineClient { /// Call one of the `disconnectSocket` methods on the implementing class to remove the socket from manager control. /// Or call `SocketIOClient.disconnect()` on the client. /// - /// - parameter forNamespace: The namespace for the socket. + /// - parameter nsp: The namespace for the socket. /// - returns: A `SocketIOClient` for the given namespace. func socket(forNamespace nsp: String) -> SocketIOClient }