Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 12, 2020
1 parent 4638617 commit c666c42
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Illuminate/Routing/RouteDependencyResolverTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ public function resolveMethodDependencies(array $parameters, ReflectionFunctionA

$values = array_values($parameters);

$shouldSkipValue = new \stdClass;
$skippableValue = new \stdClass;

foreach ($reflector->getParameters() as $key => $parameter) {
$instance = $this->transformDependency($parameter, $parameters, $shouldSkipValue);
$instance = $this->transformDependency($parameter, $parameters, $skippableValue);

if ($instance !== $shouldSkipValue) {
if ($instance !== $skippableValue) {
$instanceCount++;

$this->spliceIntoParameters($parameters, $key, $instance);
Expand All @@ -64,23 +64,23 @@ public function resolveMethodDependencies(array $parameters, ReflectionFunctionA
*
* @param \ReflectionParameter $parameter
* @param array $parameters
* @param object $shouldSkipValue
* @param object $skippableValue
* @return mixed
*/
protected function transformDependency(ReflectionParameter $parameter, $parameters, $shouldSkipValue)
protected function transformDependency(ReflectionParameter $parameter, $parameters, $skippableValue)
{
$class = $parameter->getClass();

// 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.
if ($class && ! $this->alreadyInParameters($class->name, $parameters)) {
// If it has a default value and is not already resolved, it's
// probably an optional model binding not present in the url.
return $parameter->isDefaultValueAvailable() ? null : $this->container->make($class->name);
return $parameter->isDefaultValueAvailable()
? null
: $this->container->make($class->name);
}

return $shouldSkipValue;
return $skippableValue;
}

/**
Expand Down

0 comments on commit c666c42

Please sign in to comment.