Skip to content
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

Error: Argument 1 passed to trntv\bus\locators\ClassNameLocator::addHandler() must be an instance of trntv\bus\interfaces\Handler, string given #27

Open
marty-macfly opened this issue May 11, 2019 · 0 comments

Comments

@marty-macfly
Copy link

Hello,

Thanks for this command bus. I'm Trying to use the following syntax:

Yii::$app->commandBus->locator->addHandler('app\handlers\SomeHandler', 'app\commands\SomeCommand');

And I've got that error:

Error: Argument 1 passed to trntv\bus\locators\ClassNameLocator::addHandler() must be an instance of trntv\bus\interfaces\Handler, string given

It seems to be due by the type define in function declaration in ClassNameLocator.php#L43

public function addHandler(Handler $handler, $className)

Should remove the Handler type or remove the line in documentation. Or am I mistaken on the way to use the syntax ?

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant