Skip to content

Commit

Permalink
Additional fixes for 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Jun 1, 2020
1 parent 6f2b0b7 commit 6018c1d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Container/BoundMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected static function addDependencyForCallParameter($container, $parameter,
}
} elseif ($parameter->isDefaultValueAvailable()) {
$dependencies[] = $parameter->getDefaultValue();
} elseif (! $parameter->isOptional() && ! array_key_exists($parameter->name, $parameters)) {
} elseif (! $parameter->isOptional() && ! array_key_exists($paramName, $parameters)) {
$message = "Unable to resolve dependency [{$parameter}] in class {$parameter->getDeclaringClass()->getName()}";

throw new BindingResolutionException($message);
Expand Down
6 changes: 4 additions & 2 deletions src/Illuminate/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -979,10 +979,12 @@ protected function resolveClass(ReflectionParameter $parameter)
*/
protected function resolveVariadicClass(ReflectionParameter $parameter)
{
$abstract = $this->getAlias($parameter->getClass()->name);
$className = Util::getParameterClassName($parameter);

$abstract = $this->getAlias($className);

if (! is_array($concrete = $this->getContextualConcrete($abstract))) {
return $this->make($parameter->getClass()->name);
return $this->make($className);
}

return array_map(function ($abstract) {
Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Support/Traits/ReflectsClosures.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Illuminate\Support\Traits;

use Closure;
use Illuminate\Support\Reflector;
use ReflectionFunction;
use RuntimeException;

Expand All @@ -25,7 +26,7 @@ protected function closureParameterTypes(Closure $closure)
return [$parameter->getName() => null];
}

return [$parameter->getName() => $parameter->getClass()->name ?? null];
return [$parameter->getName() => Reflector::getParameterClassName($parameter)];
})->all();
}

Expand Down

0 comments on commit 6018c1d

Please sign in to comment.