From 09da91501d3445c5a668c42e2008d1b7ee55fdf0 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 13 Feb 2012 09:19:02 -0600 Subject: [PATCH] update comment and add check to command metho_exists. --- laravel/cli/command.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/laravel/cli/command.php b/laravel/cli/command.php index fca0300e..6d7d6267 100644 --- a/laravel/cli/command.php +++ b/laravel/cli/command.php @@ -32,17 +32,17 @@ public static function run($arguments = array()) // container instead of by this class. if (Bundle::exists($bundle)) Bundle::start($bundle); - // Once the bundle has been started, we will attempt to resolve the task - // instance. Tasks may be resolved through the file system or through - // the application IoC container. $task = static::resolve($bundle, $task); + // Once the bundle has been resolved, we'll make sure we could actually + // find that task, and then verify that the method exists on the task + // so we can successfully call it without a problem. if (is_null($task)) { throw new \Exception("Sorry, I can't find that task."); } - if(method_exists($task, $method)) + if(method_exists($task, $method) or method_exists($task, '__call')) { $task->$method(array_slice($arguments, 1)); }