From 3cab6b665bc083e14986dff343fe38991cbddc64 Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Thu, 23 Feb 2017 13:54:10 +0100 Subject: [PATCH] Make sure support is not required. --- src/Illuminate/Container/BoundMethod.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Container/BoundMethod.php b/src/Illuminate/Container/BoundMethod.php index 4f09ec3cca4e..d422ea4ba78c 100644 --- a/src/Illuminate/Container/BoundMethod.php +++ b/src/Illuminate/Container/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; } /**