-
-
Notifications
You must be signed in to change notification settings - Fork 963
Pass additional arguments to a Command #158
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
Comments
Hello, |
Unfortunately, to call service inside a command I need to pass a service container to it :) Solution, IMO, is to create CommandInterface, something like this: interface CommandInterface
{
/**
* Command name
*
* @return string
*/
public function getName();
/**
* Execute command
*
* @param Telegram $telegram
* @param Update $update
*
* @return Entities\ServerResponse
*/
public function execute(Telegram $telegram, Update $update = null);
/**
* If this is a system command
*
* @return bool
*/
public function isSystemCommand();
/**
* If this is an admin command
*
* @return bool
*/
public function isAdminCommand();
/**
* If this is a user command
*
* @return bool
*/
public function isUserCommand();
} and a method |
#106 |
Yea, it may be helpful. Thank you |
Hello!
I am planing to use this package as a part of Symfony project. Is it possible to inject commands as an objects (e.g. symfony services), but not as a path to a dir with command classes?
The text was updated successfully, but these errors were encountered: