-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(console): add name
parameter to #[ConsoleArgument]
#617
feat(console): add name
parameter to #[ConsoleArgument]
#617
Conversation
Pull Request Test Coverage Report for Build 11744835865Details
💛 - Coveralls |
4c839a8
to
fe75de0
Compare
I think there's still something missing here. I've added a failing test into your branch, I'd expect this one to work. ( |
I don't think this should work if I refer to https://tempestphp.com/docs/console/building-console-commands/ If I'm not wrong the But, the input is a positional parameter, so to update its value we can't name it with But are you asking to update the actual console arg matching to also support the named param ? |
Well in Tempest, all arguments can be passed by name, including positional ones: final readonly class My
{
use HasConsole;
#[ConsoleCommand]
public function __invoke(string $foo, string $bar): void
{
$this->writeln($foo);
$this->writeln($bar);
}
} ./vendor/bin/tempest my --bar=a --foo=b
b
a So I would say that should be supported with this PR before we can merge. |
Ok thanks, |
name
parameter to #[ConsoleArgument]
773367e
to
082695e
Compare
I just pushed a few more changes:
|
This PR allow
ConsoleArgument
Attribute to have aname
parameter to override the method parameter name if wanted.This Fix #588