Skip to content

Commit

Permalink
Make sure support is not required. (#18075)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmichot authored and taylorotwell committed Feb 24, 2017
1 parent ccbfa2c commit 64062dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions BoundMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Container;

use Closure;
use ReflectionMethod;
use ReflectionFunction;
use InvalidArgumentException;
Expand Down Expand Up @@ -71,7 +72,7 @@ protected static function callClass($container, $target, array $parameters = [],
protected static function callBoundMethod($container, $callback, $default)
{
if (! is_array($callback)) {
return value($default);
return $default instanceof Closure ? $default() : $default;
}

// Here we need to turn the array callable into a Class@method string we can use to
Expand All @@ -83,7 +84,7 @@ protected static function callBoundMethod($container, $callback, $default)
return $container->callMethodBinding($method, $callback[0]);
}

return value($default);
return $default instanceof Closure ? $default() : $default;
}

/**
Expand Down

0 comments on commit 64062dc

Please sign in to comment.