Skip to content

Commit fa873a8

Browse files
authored
Merge pull request #275 from cashapp/bradfol/servicecollector-docs
Clean up ServiceCollector docs
2 parents 2c3bb49 + a709b9d commit fa873a8

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

Sources/Knit/ServiceCollection/Container+ServiceCollection.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ extension Container {
77
///
88
/// Usage:
99
/// ```
10-
/// let container = Container()
11-
/// container.addBehavior(ServiceCollector())
1210
/// container.registerIntoCollection(Animal.self) { _ in Cat(...) }
1311
/// container.registerIntoCollection(Animal.self) { _ in Dog(...) }
1412
///

Sources/Knit/ServiceCollection/Resolver+ServiceCollection.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ import Swinject
77
extension Swinject.Resolver {
88

99
/// Resolves a collection of all services registered using
10-
/// ``Container/registerIntoCollection(_:factory:)`` or
10+
/// ``Container/registerIntoCollection(_:factory:)``
1111
///
1212
/// Usage:
1313
/// ```
14-
/// let container = Container()
15-
/// container.addBehavior(ServiceCollector())
1614
/// container.registerIntoCollection(Animal.self) { _ in Cat() })
1715
/// container.registerIntoCollection(Animal.self) { _ in Dog() })
1816
///
@@ -34,12 +32,10 @@ extension Swinject.Resolver {
3432
extension Knit.Resolver {
3533

3634
/// Resolves a collection of all services registered using
37-
/// ``Container/registerIntoCollection(_:factory:)`` or
35+
/// ``Container/registerIntoCollection(_:factory:)``
3836
///
3937
/// Usage:
4038
/// ```
41-
/// let container = Container()
42-
/// container.addBehavior(ServiceCollector())
4339
/// container.registerIntoCollection(Animal.self) { _ in Cat() })
4440
/// container.registerIntoCollection(Animal.self) { _ in Dog() })
4541
///

Sources/Knit/ServiceCollection/ServiceCollector.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ import Foundation
66
import Swinject
77

88
/// A Swinject behavior that aggregates all services registered using
9-
/// ``Container/registerIntoCollection(_:factory:)`` or
9+
/// ``Container/registerIntoCollection(_:factory:)``
1010
///
1111
/// Usage:
1212
/// ```
1313
/// let container = Container()
14-
/// container.addBehavior(ServiceCollector())
14+
/// container.addBehavior(ServiceCollector()) // Note that this is done by default in Knit's ModuleAssembler
15+
///
1516
/// container.registerIntoCollection(Animal.self) { _ in Cat() })
1617
/// container.registerIntoCollection(Animal.self) { _ in Dog() })
1718
///

0 commit comments

Comments
 (0)