From 29d062da75833ec5eeefe0268c049e6ca888a2ee Mon Sep 17 00:00:00 2001 From: Dayle Rees Date: Mon, 13 Feb 2012 15:07:52 +0000 Subject: [PATCH] better handling of undefined task methods --- laravel/cli/command.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/laravel/cli/command.php b/laravel/cli/command.php index 147a8bad..fca0300e 100644 --- a/laravel/cli/command.php +++ b/laravel/cli/command.php @@ -42,7 +42,14 @@ public static function run($arguments = array()) throw new \Exception("Sorry, I can't find that task."); } - $task->$method(array_slice($arguments, 1)); + if(method_exists($task, $method)) + { + $task->$method(array_slice($arguments, 1)); + } + else + { + throw new \Exception("Sorry, I can't find that method!"); + } } /** @@ -186,4 +193,4 @@ protected static function format($bundle, $task) return '\\'.$prefix.Str::classify($task).'_Task'; } -} \ No newline at end of file +}