Closed cordoval closed 10 years ago
@pmjones @harikt bang bang! :blush:
@cordoval not sure I get you.
I am looking at the example and trying to figure out
$help_service = $di->get('aura/cli-kernel:help_service');
$help = $di->newInstance('Aura\Cli\Help');
$help_service->set('hello', function () use ($help) {
$help->setUsage(array('', '<noun>'));
$help->setSummary("A demonstration 'hello world' command.");
return $help;
});
Is your question is like setting Aura\Cli\Help
as a service
$di->set('aura/cli-kernel:help', $di->newInstance('Aura\Cli\Help'));
and use
$help_service = $di->get('aura/cli-kernel:help_service');
$help = $di->get('aura/cli-kernel:help');
$help_service->set('hello', function () use ($help) {
$help->setUsage(array('', '<noun>'));
$help->setSummary("A demonstration 'hello world' command.");
return $help;
});
right exactly, it seems to me it is more proper
should I send a PR?
@cordoval you can send PR.
Just remember the final word you should hear is from @pmjones .
Thank you.
yeah i know, I just want to voice my concerns :blush: nothing harsh or personal, just going through some code reading, you guys caught once again my attention.
The Help instance should not be a shared service; it has to be a instance separate from every other Help instance. (Each Help instance is specific to the command it is a Help for.) Hope that makes sense.
same argument as the other issue, not here, but sometimes you want to share helpers, this occurs massively in other projects, such as phpcr, gush, etc.
This is not a "helper" of that kind. It is a way of describing the help output when you ask for help about a command at the command line.
oh true, my bad, terminology is killing me :+1:
yeah totally, i was looking through the things via symfony glasses, I need to think outside the box :+1: :eyeglasses: :arrow_forward: :eyes:
besides creating a new instance of the Help, i wonder if this should be pushed to the di with a service id that is distinguishable besides being passed just in the use () of the callback. Do you follow what I am trying to ask? it just feels weird.