Skip to content

Commit

Permalink
Refactor: check for contextual attribute before getting parameter cla…
Browse files Browse the repository at this point in the history
…ss name (#53339)
  • Loading branch information
korkoshko authored Oct 30, 2024
1 parent 7017b40 commit bdedd46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Routing/ResolvesRouteDependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ public function resolveMethodDependencies(array $parameters, ReflectionFunctionA
*/
protected function transformDependency(ReflectionParameter $parameter, $parameters, $skippableValue)
{
$className = Reflector::getParameterClassName($parameter);

if ($attribute = Util::getContextualAttributeFromDependency($parameter)) {
return $this->container->resolveFromAttribute($attribute);
}

$className = Reflector::getParameterClassName($parameter);

// If the parameter has a type-hinted class, we will check to see if it is already in
// the list of parameters. If it is we will just skip it as it is probably a model
// binding and we do not want to mess with those; otherwise, we resolve it here.
Expand Down

0 comments on commit bdedd46

Please sign in to comment.