-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$task_name can be undefined in Cli.php #62
Comments
Do you have an example of where this would occur? I stepped back through Phake to try to see where it might throw that exception, but I didn't notice anything. |
|
Interesting. So a node that has dependencies is unable to find its dependency. A quick workaround would be to insert a try/catch block into the However calling |
Plugin task has nonexistent task in requirements. |
I see. How do you feel about this? protected function print_tasks()
{
try {
$task_list = $this->app->get_task_list();
if(!count($task_list)) return;
$max = max(array_map('strlen', array_keys($task_list)));
foreach($task_list as $name => $desc)
echo str_pad($name, $max + 4) . $desc . "\n";
} catch (Exception $e) {
$this->fatal($e, "Couldn't build the task list.");
}
} |
I think that it'll OK for now. And I hope that my PR in some way will be accepted in Phake, so task name can be extracted from exception like this: // exec
} catch (\phake\TaskNotFoundException $tnfe) {
$this->fatal($tnfe, "Task '{$tnfe->getTaskName()}' not found\n");
} |
Great. Yeah, that would be nice if we could do that. |
Changes made in Phake master, so |
Even better. Thank you! |
Maybe Phake can cut a release so this can get into Pomander? |
About Phake release: https://twitter.com/jaz303/status/608573142886445057 |
Excellent. I'll keep an eye on the repo. |
In Cli.php TaskNotFoundException can be thrown by print_tasks method, so here variable $task_name will be undefined.
Unfortunately at this time no way to get missed task name here, but I've create PR to Phake in order to solve this.
The text was updated successfully, but these errors were encountered: