@@ -25,8 +25,9 @@ public function __construct(?ContainerInterface $container = null)
2525 }
2626
2727 /**
28- * @param class-string $className
29- * @return mixed
28+ * @template T
29+ * @param class-string<T> $className
30+ * @return T
3031 *
3132 * @throws InvalidArgumentException If class does not exist.
3233 * @throws ContainerExceptionInterface If error occurs while retrieving the existing entry from the container.
@@ -47,9 +48,10 @@ public function resolve(string $className): mixed
4748 }
4849
4950 /**
50- * @param class-string $className
51+ * @template T
52+ * @param class-string<T> $className
5153 * @param array<string,mixed> $bindings
52- * @return mixed
54+ * @return T
5355 *
5456 * @throws ClassCannotBeInstantiated
5557 * @throws CannotAutowireDependencyArgument
@@ -125,7 +127,6 @@ private function resolveParameters(array $parameters, array $bindings = []): arr
125127 }
126128
127129 /**
128- * @param ParameterReflection $parameter
129130 * @return mixed|null
130131 *
131132 * @throws CannotAutowireArgument
@@ -136,7 +137,7 @@ private function resolveParameter(ParameterReflection $parameter): mixed
136137 if ($ type ->isClassRequirement () && $ this ->container ->has ($ class = $ type ->getClassRequirement ())) {
137138 try {
138139 return $ this ->container ->get ($ class );
139- } catch (ContainerExceptionInterface $ exception ) {
140+ } catch (ContainerExceptionInterface ) {
140141 throw new CannotAutowireArgument ($ parameter ->getName ());
141142 }
142143 }
@@ -155,7 +156,7 @@ private function resolveParameter(ParameterReflection $parameter): mixed
155156 $ class = $ type ->getClassRequirement ();
156157 try {
157158 return $ this ->construct ($ class );
158- } catch (DependencyResolutionException $ exception ) {
159+ } catch (DependencyResolutionException ) {
159160 // try another one
160161 }
161162 }
0 commit comments