diff --git a/BoundMethod.php b/BoundMethod.php index 4f09ec3..d422ea4 100644 --- a/BoundMethod.php +++ b/BoundMethod.php @@ -2,6 +2,7 @@ namespace Illuminate\Container; +use Closure; use ReflectionMethod; use ReflectionFunction; use InvalidArgumentException; @@ -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 @@ -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; } /**