better handling of undefined task methods
This commit is contained in:
@@ -42,7 +42,14 @@ class Command {
|
|||||||
throw new \Exception("Sorry, I can't find that task.");
|
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 @@ class Command {
|
|||||||
return '\\'.$prefix.Str::classify($task).'_Task';
|
return '\\'.$prefix.Str::classify($task).'_Task';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user