Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit85a8dca

Browse files
authored
Allow access to ServiceEntry properties (#575)
1 parent91ac1af commit85a8dca

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
publicprotocolBehavior{
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 typeforwading methods
8+
/// one of the `register()` or typeforwarding 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
extensionContainer{
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
publicfinalclassServiceEntry<Service>:ServiceEntryProtocol{
2020
fileprivatevarinitCompletedActions:[(Resolver,Service)->Void]=[]
21-
internalletserviceType:Any.Type
22-
internalletargumentsType:Any.Type
21+
publicletserviceType:Any.Type
22+
publicletargumentsType:Any.Type
2323

2424
internalletfactory:FunctionType
2525
internal weakvarcontainer:Container?

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp