From bb19f85748f8e022a03f655eb7df6bde19ff13ff Mon Sep 17 00:00:00 2001 From: Caleb Porzio Date: Thu, 8 Dec 2016 17:14:32 -0500 Subject: [PATCH] Fix potential resolve() helper function conflict (#218) --- cli/includes/facades.php | 6 +++++- cli/includes/helpers.php | 20 +++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/cli/includes/facades.php b/cli/includes/facades.php index 2488185..737d997 100644 --- a/cli/includes/facades.php +++ b/cli/includes/facades.php @@ -1,5 +1,7 @@ make(static::containerKey()); + + return call_user_func_array([$resolvedInstance, $method], $parameters); } } diff --git a/cli/includes/helpers.php b/cli/includes/helpers.php index 66322ab..34b4400 100644 --- a/cli/includes/helpers.php +++ b/cli/includes/helpers.php @@ -46,15 +46,17 @@ function output($output) (new Symfony\Component\Console\Output\ConsoleOutput)->writeln($output); } -/** - * Resolve the given class from the container. - * - * @param string $class - * @return mixed - */ -function resolve($class) -{ - return Container::getInstance()->make($class); +if (! function_exists('resolve')) { + /** + * Resolve the given class from the container. + * + * @param string $class + * @return mixed + */ + function resolve($class) + { + return Container::getInstance()->make($class); + } } /**