Skip to content

Commit 5433c4f

Browse files
committed
chore: rename dependency -> service in decorator class
1 parent c0d1d68 commit 5433c4f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/dependency_injection/decorator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ def wrapper_inject(*args: Any, **kwargs: Any) -> Any:
2424
sig = inspect.signature(func)
2525
parameter_names = [param.name for param in sig.parameters.values()]
2626

27-
# Iterate over the parameter names and inject dependencies into kwargs
27+
# Iterate over the parameter names and inject services into kwargs
2828
for parameter_name in parameter_names:
2929
if parameter_name != "cls" and parameter_name not in kwargs:
3030
# get container
3131
container = DependencyContainer.get_instance(container_name)
3232
actual_scope_name = scope_name or container.get_default_scope_name()
33-
# Resolve the dependency based on the parameter name
34-
dependency_type = sig.parameters[parameter_name].annotation
33+
# Resolve the service in the parameter type annotation
34+
service = sig.parameters[parameter_name].annotation
3535
kwargs[parameter_name] = container.resolve(
36-
dependency_type, scope_name=actual_scope_name
36+
service, scope_name=actual_scope_name
3737
)
3838

39-
# Call the original function with the injected dependencies
39+
# Call the original function with the injected services
4040
return func(*args, **kwargs)
4141

4242
# Not allowed on instance methods

0 commit comments

Comments
 (0)