Skip to content

Commit f7fbbda

Browse files
committed
Fix couple of typos
1 parent 56b0768 commit f7fbbda

File tree

12 files changed

+19
-19
lines changed

12 files changed

+19
-19
lines changed

SampleApp/DipSampleApp/Providers/SWAPIPersonProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import Foundation
1010

11-
///Provides Person entitis fetching them with web service
11+
///Provides Person entities fetching them with web service
1212
struct SWAPIPersonProvider : PersonProviderAPI {
1313
let ws: NetworkLayer
1414

Sources/AutoInjection.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public extension Injected {
237237
For that reason if you resolve instance that has a _weak_ auto-injected property this property
238238
will be released when `resolve` will complete.
239239

240-
Use `InjectedWeak<T>` to define one of two circular dependecies if another dependency is defined as `Injected<U>`.
240+
Use `InjectedWeak<T>` to define one of two circular dependencies if another dependency is defined as `Injected<U>`.
241241
This will prevent a retain cycle between resolved instances.
242242

243243
- warning: Do not define this property as optional or container will not be able to inject it.
@@ -299,7 +299,7 @@ public struct InjectedWeak<T>: _InjectedPropertyBox, AutoInjectedPropertyBox {
299299
For that reason if you resolve instance that has a _weak_ auto-injected property this property
300300
will be released when `resolve` will complete.
301301

302-
Use `InjectedWeak<T>` to define one of two circular dependecies if another dependency is defined as `Injected<U>`.
302+
Use `InjectedWeak<T>` to define one of two circular dependencies if another dependency is defined as `Injected<U>`.
303303
This will prevent a retain cycle between resolved instances.
304304

305305
- warning: Do not define this property as optional or container will not be able to inject it.

Sources/Definition.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public final class Definition<T, U>: DefinitionType {
206206

207207
//definitions for types that can be resolved by `forwardsTo` definition
208208
//can also be used to resolve self type and it's implementing types
209-
//this way container properly reuses previosly resolved instances
209+
//this way container properly reuses previously resolved instances
210210
//when there are several forwarded definitions
211211
//see testThatItReusesInstanceResolvedByTypeForwarding)
212212
for definition in forwardsTo.forwardsFrom {
@@ -292,17 +292,17 @@ class DefinitionBuilder<T, U> {
292292

293293
typealias KeyDefinitionPair = (key: DefinitionKey, definition: _Definition)
294294

295-
/// Definitions are matched if they are registered for the same tag and thier factories accept the same number of runtime arguments.
295+
/// Definitions are matched if they are registered for the same tag and their factories accept the same number of runtime arguments.
296296
private func ~=(lhs: KeyDefinitionPair, rhs: KeyDefinitionPair) -> Bool {
297297
guard lhs.key.type == rhs.key.type else { return false }
298298
guard lhs.key.tag == rhs.key.tag else { return false }
299299
guard lhs.definition.numberOfArguments == rhs.definition.numberOfArguments else { return false }
300300
return true
301301
}
302302

303-
/// Returns key-defintion pairs with definitions able to resolve that type (directly or via type forwarding)
303+
/// Returns key-definition pairs with definitions able to resolve that type (directly or via type forwarding)
304304
/// and which tag matches provided key's tag or is nil if strictByTag is false.
305-
/// In the end filters defintions by type of runtime arguments.
305+
/// In the end filters definitions by type of runtime arguments.
306306
func filter(definitions _definitions: [KeyDefinitionPair], byKey key: DefinitionKey, strictByTag: Bool = false, byTypeOfArguments: Bool = false) -> [KeyDefinitionPair] {
307307
let definitions = _definitions
308308
.filter({ $0.key.type == key.type || $0.definition.doesImplements(type: key.type) })

Sources/Dip.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public final class DependencyContainer {
9494
Call this method to complete container setup. After container is bootstrapped
9595
you can not add or remove definitions. Trying to do so will cause runtime exception.
9696
You can completely reset container, after reset you can bootstrap it again.
97-
During bootsrap container will instantiate components registered with `EagerSingleton` scope.
97+
During bootstrap container will instantiate components registered with `EagerSingleton` scope.
9898

9999
- throws: `DipError` if failed to instantiate any component
100100
*/
@@ -298,7 +298,7 @@ extension DependencyContainer {
298298
for collaborator in _collaborators {
299299
//if container is already in a context resolving this type
300300
//it means that it has been already called to resolve this type,
301-
//so there is probably a cercular reference between containers.
301+
//so there is probably a circular reference between containers.
302302
//To break it skip this container
303303
if let context = collaborator.context, context.resolvingType == key.type && context.tag == key.tag { continue }
304304

@@ -453,7 +453,7 @@ extension DependencyContainer: CustomStringConvertible {
453453
//MARK: - DependencyTagConvertible
454454

455455
/// Implement this protocol on your type if you want to use its instances as `DependencyContainer`'s tags.
456-
/// `DependencyContainer.Tag`, `String`, `Int` and any `RawRepresentable` with `RawType` of `String` or `Int` by default confrom to this protocol.
456+
/// `DependencyContainer.Tag`, `String`, `Int` and any `RawRepresentable` with `RawType` of `String` or `Int` by default conform to this protocol.
457457
public protocol DependencyTagConvertible {
458458
var dependencyTag: DependencyContainer.Tag { get }
459459
}

Sources/DipError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public enum DipError: Error, CustomStringConvertible {
6666
case ambiguousDefinitions(type: Any.Type, definitions: [DefinitionType])
6767

6868
/**
69-
Thrown by `resolve(tag:)` if resolved instance does not implemenet resolved type (i.e. when type-forwarding).
69+
Thrown by `resolve(tag:)` if resolved instance does not implement resolved type (i.e. when type-forwarding).
7070

7171
- parameters:
7272
- resolved: Resolved instance

Sources/Resolve.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ extension DependencyContainer {
8181

8282
- parameters:
8383
- tag: The arbitrary tag to use to lookup definition.
84-
- builder: Generic closure that accepts generic factory and returns inctance created by that factory.
84+
- builder: Generic closure that accepts generic factory and returns instance created by that factory.
8585

8686
- throws: `DipError.DefinitionNotFound`, `DipError.AutoInjectionFailed`, `DipError.AmbiguousDefinitions`, `DipError.InvalidType`
8787

Sources/RuntimeArguments.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ extension DependencyContainer {
9898
}
9999
```
100100

101-
Though before you do so you should probably review your design and try to reduce number of depnedencies.
101+
Though before you do so you should probably review your design and try to reduce number of dependencies.
102102
*/
103103
public func register<T, U>(scope: ComponentScope, type: T.Type, tag: DependencyTagConvertible?, factory: @escaping (U) throws -> T, numberOfArguments: Int, autoWiringFactory: @escaping (DependencyContainer, Tag?) throws -> T) -> Definition<T, U> {
104104
let definition = DefinitionBuilder<T, U> {
@@ -141,7 +141,7 @@ extension DependencyContainer {
141141
which factories accept any number of runtime arguments and are tagged with the same tag,
142142
passed to `resolve` method, or with no tag. Container will try to use these definitions
143143
to resolve a component one by one until one of them succeeds, starting with tagged definitions
144-
in order of decreasing their's factories number of arguments. If none of them succeds it will
144+
in order of decreasing their's factories number of arguments. If none of them succeeds it will
145145
throw an error. If it finds two definitions with the same number of arguments - it will throw
146146
an error.
147147

Tests/DipTests/AutoInjectionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ class AutoInjectionTests: XCTestCase {
488488
XCTAssertNil(server)
489489
}
490490

491-
func testThatItAutoInjectsWhenOverridenInDefinition() {
491+
func testThatItAutoInjectsWhenOverriddenInDefinition() {
492492
let container = DependencyContainer(autoInjectProperties: false)
493493
container.register { ServerImp() as Server }
494494
container.register { ClientImp() as Client }

Tests/DipTests/ComponentScopeTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ class ComponentScopeTests: XCTestCase {
316316
container.register(service, type: Service.self)
317317

318318
//when
319-
//resolve and realease reight away
319+
//resolve and release right away
320320
_ = try? container.resolve() as ServiceImp1
321321

322322
//then

Tests/DipTests/DefinitionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class DefinitionTests: XCTestCase {
100100
XCTAssertFalse(blockCalled)
101101
}
102102

103-
func testThatItRegisteresOptionalTypesAsForwardedTypes() {
103+
func testThatItRegistersOptionalTypesAsForwardedTypes() {
104104
let def = Definition<Service, ()>(scope: .unique) { ServiceImp() as Service }
105105

106106
XCTAssertTrue(def.implementingTypes.contains(where: { $0 == Service?.self }))

0 commit comments

Comments
 (0)