Skip to content

Commit 7bda8cc

Browse files
author
Daniel Browne
committed
Remove redundant instances of 'internal' access level
1 parent 2a70ee7 commit 7bda8cc

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

Sources/Extensions/PusherWebsocketDelegate.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ extension PusherConnection: WebSocketConnectionDelegate {
117117
`PusherChannelsProtocolCloseCode.ReconnectionStrategy`.
118118
- Parameter closeCode: The closure code received by the WebSocket connection.
119119
*/
120-
internal func attemptReconnect(closeCode: NWProtocolWebSocket.CloseCode = .protocolCode(.normalClosure)) {
120+
func attemptReconnect(closeCode: NWProtocolWebSocket.CloseCode = .protocolCode(.normalClosure)) {
121121
guard connectionState != .connected else {
122122
return
123123
}
@@ -161,7 +161,7 @@ extension PusherConnection: WebSocketConnectionDelegate {
161161
/// Returns a `TimeInterval` appropriate for a reconnection attempt after some delay.
162162
/// - Parameter strategy: The reconnection strategy for the reconnection attempt.
163163
/// - Returns: An appropriate `TimeInterval`. (0.0 if `strategy == .reconnectImmediately`).
164-
internal func reconnectionAttemptTimeInterval(strategy: PusherChannelsProtocolCloseCode.ReconnectionStrategy) -> TimeInterval {
164+
func reconnectionAttemptTimeInterval(strategy: PusherChannelsProtocolCloseCode.ReconnectionStrategy) -> TimeInterval {
165165
if case .reconnectImmediately = strategy {
166166
return 0.0
167167
}
@@ -174,7 +174,7 @@ extension PusherConnection: WebSocketConnectionDelegate {
174174

175175
/// Logs the websocket reconnection attempt.
176176
/// - Parameter strategy: The reconnection strategy for the reconnection attempt.
177-
internal func logReconnectionAttempt(strategy: PusherChannelsProtocolCloseCode.ReconnectionStrategy) {
177+
func logReconnectionAttempt(strategy: PusherChannelsProtocolCloseCode.ReconnectionStrategy) {
178178

179179
var context = "(attempt \(reconnectAttempts + 1))"
180180
var loggingEvent = PusherLogger.LoggingEvent.attemptReconnectionImmediately
@@ -197,7 +197,7 @@ extension PusherConnection: WebSocketConnectionDelegate {
197197
/// - Parameters:
198198
/// - closeCode: The closure code for the websocket connection.
199199
/// - reason: Optional further information on the connection closure.
200-
internal func logDisconnection(closeCode: NWProtocolWebSocket.CloseCode, reason: Data?) {
200+
func logDisconnection(closeCode: NWProtocolWebSocket.CloseCode, reason: Data?) {
201201
var rawCode: UInt16!
202202
switch closeCode {
203203
case .protocolCode(let definedCode):

Sources/Helpers/PusherLogger.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import Foundation
22

33
/// Used for logging events for informational purposes
4-
internal class PusherLogger {
4+
class PusherLogger {
55

66
// MARK: - Enum definitions
77

8-
internal enum LoggingEvent: String {
8+
enum LoggingEvent: String {
99

1010
// Channels
1111

1212
// swiftlint:disable:next identifier_name
1313
case presenceChannelSubscriptionAttemptWithoutChannelData =
14-
"Attempting to subscribe to presence channel but no channelData value provided"
14+
"Attempting to subscribe to presence channel but no channelData value provided"
1515
case subscriptionSucceededNoDataInPayload = "Subscription succeeded event received without data key in payload"
1616
case unableToSubscribeToChannel = "Unable to subscribe to channel:"
1717
case unableToAddMemberToChannel = "Unable to add member to channel"
@@ -61,52 +61,52 @@ internal class PusherLogger {
6161
case unableToHandleIncomingMessage = "Unable to handle incoming Websocket message"
6262
}
6363

64-
internal enum LoggingLevel: String {
64+
enum LoggingLevel: String {
6565
case debug = "[PUSHER DEBUG]"
6666
case info = "[PUSHER INFO]"
6767
case warning = "[PUSHER WARNING]"
6868
case error = "[PUSHER ERROR]"
6969
}
7070

71-
internal static let shared = PusherLogger()
71+
static let shared = PusherLogger()
7272

73-
internal weak var delegate: PusherDelegate?
73+
weak var delegate: PusherDelegate?
7474

7575
// MARK: - Event logging
7676

7777
/// Logs a debug message relating to a particular event of interest.
7878
/// - Parameters:
7979
/// - event: A particular `LoggingEvent` of interest.
8080
/// - context: Additional context for the message.
81-
internal func debug(for event: LoggingEvent,
82-
context: CustomStringConvertible? = nil) {
81+
func debug(for event: LoggingEvent,
82+
context: CustomStringConvertible? = nil) {
8383
message(for: event, level: .debug, context: context)
8484
}
8585

8686
/// Logs an informational message relating to a particular event of interest.
8787
/// - Parameters:
8888
/// - event: A particular `LoggingEvent` of interest.
8989
/// - context: Additional context for the message.
90-
internal func info(for event: LoggingEvent,
91-
context: CustomStringConvertible? = nil) {
90+
func info(for event: LoggingEvent,
91+
context: CustomStringConvertible? = nil) {
9292
message(for: event, level: .info, context: context)
9393
}
9494

9595
/// Logs a warning message relating to a particular event of interest.
9696
/// - Parameters:
9797
/// - event: A particular `LoggingEvent` of interest.
9898
/// - context: Additional context for the message.
99-
internal func warning(for event: LoggingEvent,
100-
context: CustomStringConvertible? = nil) {
99+
func warning(for event: LoggingEvent,
100+
context: CustomStringConvertible? = nil) {
101101
message(for: event, level: .warning, context: context)
102102
}
103103

104104
/// Logs an error message relating to a particular event of interest.
105105
/// - Parameters:
106106
/// - event: A particular `LoggingEvent` of interest.
107107
/// - context: Additional context for the message.
108-
internal func error(for event: LoggingEvent,
109-
context: CustomStringConvertible? = nil) {
108+
func error(for event: LoggingEvent,
109+
context: CustomStringConvertible? = nil) {
110110
message(for: event, level: .error, context: context)
111111
}
112112

Sources/Helpers/PusherParser.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
internal struct PusherParser {
3+
struct PusherParser {
44

55
/**
66
Parse a string to extract Pusher event information from it

Sources/Models/PusherChannelsProtocolCloseCode.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import Foundation
77
/// These closure codes fall in the 4000 - 4999 range, i.e. the `privateCode` case of `NWProtocolWebSocket.CloseCode`.
88
///
99
/// Reference: https://pusher.com/docs/channels/library_auth_reference/pusher-websockets-protocol#error-codes
10-
internal enum PusherChannelsProtocolCloseCode: UInt16 {
10+
enum PusherChannelsProtocolCloseCode: UInt16 {
1111

1212
// MARK: - Pusher Channels Protocol reconnection strategies
1313

1414
/// Describes the reconnection strategy for a given `PusherChannelsProtocolCloseCode`.
1515
///
1616
/// Reference: https://pusher.com/docs/channels/library_auth_reference/pusher-websockets-protocol#connection-closure
17-
internal enum ReconnectionStrategy: UInt16 {
17+
enum ReconnectionStrategy: UInt16 {
1818

1919
/// Indicates an error resulting in the connection being closed by Pusher Channels,
2020
/// and that attempting to reconnect using the same parameters will not succeed.

0 commit comments

Comments
 (0)