Skip to content

Commit bdedd46

Browse files
authored
Refactor: check for contextual attribute before getting parameter class name (#53339)
1 parent 7017b40 commit bdedd46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Illuminate/Routing/ResolvesRouteDependencies.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ public function resolveMethodDependencies(array $parameters, ReflectionFunctionA
7575
*/
7676
protected function transformDependency(ReflectionParameter $parameter, $parameters, $skippableValue)
7777
{
78-
$className = Reflector::getParameterClassName($parameter);
79-
8078
if ($attribute = Util::getContextualAttributeFromDependency($parameter)) {
8179
return $this->container->resolveFromAttribute($attribute);
8280
}
8381

82+
$className = Reflector::getParameterClassName($parameter);
83+
8484
// If the parameter has a type-hinted class, we will check to see if it is already in
8585
// the list of parameters. If it is we will just skip it as it is probably a model
8686
// binding and we do not want to mess with those; otherwise, we resolve it here.

0 commit comments

Comments
 (0)