-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Drop compatibility with callable response factories on MethodNotAllowedMiddleware
and ImplicitOptionsMiddleware
#69
Drop compatibility with callable response factories on MethodNotAllowedMiddleware
and ImplicitOptionsMiddleware
#69
Conversation
MethodNotAllowedMiddleware
MethodNotAllowedMiddleware
and ImplicitOptionsMiddleware
if (! $container->has(ResponseFactoryInterface::class)) { | ||
throw MissingDependencyException::dependencyForService( | ||
ResponseFactoryInterface::class, | ||
ImplicitOptionsMiddleware::class, | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to have this kind of exception handling in each factory?
Feels simpler to improve laminas/laminas-servicemanager
to better inspect traces, perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think that the traces are already easy enough to figure out, without this kind of specific exception, but I was just following convention here and didn't think it was worth breaking BC with documented @throws
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me, it's just something we should perhaps improve in upstream, by rendering better traces in exceptions in a future iteration.
We can decide to drop them overall from this component in a later patch: the redundant ->has()
calls all add up quickly, if every service needs to do them
…wedMiddleware` Signed-off-by: George Steel <george@net-glue.co.uk>
…are` Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
Signed-off-by: George Steel <george@net-glue.co.uk>
82ab78e
to
567cc25
Compare
Description
ResponseFactoryInterface
CallableResponseFactoryDecorator