Skip to content

Commit 85a8dca

Browse files
authored
Allow access to ServiceEntry properties (#575)
1 parent 91ac1af commit 85a8dca

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Sources/Behavior.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
/// Protocol for adding functionality to the container
66
public protocol Behavior {
77
/// This will be invoked on each behavior added to the `container` for each `entry` added to the container using
8-
/// one of the `register()` or type forwading methods
8+
/// one of the `register()` or type forwarding methods
99
///
1010
/// - Parameters:
1111
/// - container: container into which an `entry` has been registered
1212
/// - type: Type which will be resolved using the `entry`
1313
/// - entry: ServiceEntry registered to the `container`
1414
/// - name: name under which the service has been registered to the `container`
1515
///
16-
/// - Remark: `Type` and `Service` can be different types in the case of type forwarding
16+
/// - Remark: `Type` and `Service` can be different types in the case of type forwarding (commonly used as `.implements()`).
17+
/// `Type` will represent the forwarded type key, and `Service` will represent the destination.
1718
func container<Type, Service>(
1819
_ container: Container,
1920
didRegisterType type: Type.Type,

Sources/Container.Arguments.erb

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

1919
import Foundation
2020

21-
// MARK: - Registeration with Arguments
21+
// MARK: - Registration with Arguments
2222
extension Container {
2323
<% (1..arg_count).each do |i| %>
2424
<% arg_types = (1..i).map { |n| "Arg#{n}" }.join(", ") %>

Sources/Container.Arguments.swift

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

1313
import Foundation
1414

15-
// MARK: - Registeration with Arguments
15+
// MARK: - Registration with Arguments
1616

1717
extension Container {
1818
/// Adds a registration for the specified service with the factory closure to specify how the service is resolved with dependencies.

Sources/ServiceEntry.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ internal protocol ServiceEntryProtocol: AnyObject {
1818
/// As a returned instance from ``Container/register(_:name:factory:)-8gy9r``, some configurations can be added.
1919
public final class ServiceEntry<Service>: ServiceEntryProtocol {
2020
fileprivate var initCompletedActions: [(Resolver, Service) -> Void] = []
21-
internal let serviceType: Any.Type
22-
internal let argumentsType: Any.Type
21+
public let serviceType: Any.Type
22+
public let argumentsType: Any.Type
2323

2424
internal let factory: FunctionType
2525
internal weak var container: Container?

0 commit comments

Comments
 (0)