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

Override CallbackResolver #9

Closed
praswicaksono opened this issue Jan 29, 2016 · 2 comments
Closed

Override CallbackResolver #9

praswicaksono opened this issue Jan 29, 2016 · 2 comments

Comments

@praswicaksono
Copy link
Contributor

currently in 1.3 CallbackResolver class only process valid callable and formatted service name servicename:method. Since mostly I use class name as service ID it feel weird if I pass callable service name. For example

$app->get('/{name}', HelloName::class)
    ->convert('req', HelloNameConverter::class . ':__invoke');

i have to append with ':__invoke' each callback. I proposed to override CallbackResolver so it can pass any callable service name without append ':__invoke'

@mnapoli
Copy link
Member

mnapoli commented Jan 30, 2016

Hi, this is a very good idea.

The Silex\CallbackResolver class could be overridden with an implementation that could call Invoker\CallableResolver::resolve() to resolve the callable.

We might need to keep support of the official notation though (service:method) so that users are not confused…

Feel free to submit a pull request.

mnapoli added a commit that referenced this issue Feb 4, 2016
@mnapoli
Copy link
Member

mnapoli commented Feb 4, 2016

Documentation added in f53a571 and I've released 1.4.0. Thanks again!

@mnapoli mnapoli closed this as completed Feb 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants