Skip to content

Commit 07ff33d

Browse files
committed
review: Quick Renaming nowDate to now
1 parent 8604faf commit 07ff33d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ElementX/Sources/Services/ElementCall/ElementCallService.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import UIKit
1717
// Keep this class testable
1818
struct Time {
1919
var clock: any Clock<Duration>
20-
var nowDate: () -> Date
20+
var now: () -> Date
2121
}
2222

2323
class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDelegate, CXProviderDelegate {
@@ -69,7 +69,7 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
6969
init(callProvider: CXProviderProtocol? = nil, timeClock: Time? = nil) {
7070
pushRegistry = PKPushRegistry(queue: nil)
7171

72-
self.timeClock = timeClock ?? Time(clock: ContinuousClock(), nowDate: Date.init)
72+
self.timeClock = timeClock ?? Time(clock: ContinuousClock(), now: Date.init)
7373

7474
if let callProvider {
7575
self.callProvider = callProvider
@@ -182,7 +182,7 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
182182
return
183183
}
184184

185-
let nowDate = timeClock.nowDate()
185+
let nowDate = timeClock.now()
186186

187187
guard nowDate < expirationDate else {
188188
MXLog.warning("Call expired for room \(roomID), ignoring incoming push")

UnitTests/Sources/ElementCallServiceTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class ElementCallServiceTests: XCTestCase {
106106
let dateProvider: () -> Date = {
107107
self.currentDate
108108
}
109-
service = ElementCallService(callProvider: callProvider, timeClock: Time(clock: testClock, nowDate: dateProvider))
109+
service = ElementCallService(callProvider: callProvider, timeClock: Time(clock: testClock, now: dateProvider))
110110
}
111111
}
112112

0 commit comments

Comments
 (0)