Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
lorisleiva committed May 23, 2020
1 parent 17c69bd commit 26d86c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Concerns/ResolvesMethodDependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected function resolveDependency(ReflectionParameter $parameter, $extras = [
return $value;
}

if ($key && is_subclass_of($class->name, UrlRoutable::class)) {
if ($key && $class && is_subclass_of($class->name, UrlRoutable::class)) {
return $this->resolveRouteBinding($class->name, $key, $value, $parameter->allowsNull());
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ResolvesMethodDependenciesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function it_returns_null_when_nullable_type_hinted_models_cannot_be_found
{
$this->loadLaravelMigrations();

$action = new class(['user' => null]) extends Action {
$action = new class(['user' => 42]) extends Action {
public function handle(?User $user) {
return $user;
}
Expand Down

0 comments on commit 26d86c4

Please sign in to comment.