better handling of undefined task methods

This commit is contained in:
Dayle Rees 2012-02-13 15:07:52 +00:00
parent 620f3ba91f
commit 29d062da75
1 changed files with 9 additions and 2 deletions

View File

@ -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!");
}
}
/**