From 64062dca34aa1b24367c11dfc9a5eb76c7070a2d Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Fri, 24 Feb 2017 03:15:47 +0100 Subject: [PATCH] Make sure support is not required. (#18075) --- BoundMethod.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } /**