-
Notifications
You must be signed in to change notification settings - Fork 13
Provide factories and a ConfigProvider #57
Provide factories and a ConfigProvider #57
Conversation
a98a7aa
to
42dd304
Compare
42dd304
to
17735a9
Compare
17735a9
to
e6c534d
Compare
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.
Travis build is failing on PHP 5.6:
PHP Fatal error: Cannot use RuntimeException as RuntimeException because the name is already in use in /home/travis/build/zendframework/zend-expressive-router/src/Exception/MissingDependencyException.php on line 11
And in general it's fine, I like adding ConfigProvider but we need to check zend-component-installer
if it will inject ConfigProvider
to the config on package update.
e6c534d
to
9670557
Compare
93ca715
to
0f06f57
Compare
I've rebased this now off my current work for #55; it should be ready for review. |
0f06f57
to
e251008
Compare
This is also ready for review. zend-component-installer does not operate on update; this is so that users do not get prompted for a package they've already indicated they do not want to install configuration for. We will need to message to users to add this — however, all features in this package are opt-in by nature, so having the configuration immediately available is not as necessary. |
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.
Use composer suggest? Not that many read this :) |
Imports the following middleware and their related tests, adapting them to work under PHP 5.6: - ImplicitHeadMiddleware - ImplicitOptionsMiddleware - MethodNotAllowedMiddleware
Since we cannot fix the major issues with implicit HEAD and OPTIONS requests without a BC break, we need for the backported middleware to support v2 conventions. In this case, we'll look for `implicitHead()` support.
Similar to previous patch regarding ImplicitHeadMiddleware; this adapts to follow the conventions of v2, and uses `implicitOptions()` to determine whether or not to intervene.
- implicitHead - implicitOptions
e251008
to
20135f5
Compare
Improves the testInvokesHandlerWhenRouteImplicitlySupportsHeadAndSupportsGet logic to properly exercise a case where a HEAD request is issued, the route does not explicitly support it, but _does_ support a GET request. In doing so, discovered that the final return statement was incorrectly using the response prototype, instead of the response returned from the GET request.
Adds factories for each of: - DispatchMiddleware - ImplicitHeadMiddleware - ImplicitOptionsMiddleware - RouteMiddleware Whenever a response prototype is needed by the underlying middleware, the factory checks for either a response instance returned, or a callable; in the latter case, it invokes the callable to retrieve a new response instance to inject. Conflicts: composer.lock
Adds `Zend\Expressive\Router\ConfigProvider`, with dependencies mapped for all new middleware shipped. The package is exposed to zend-config-provider as well. Conflicts: composer.lock
20135f5
to
c94430d
Compare
This patch adds factories for each of:
Whenever a response prototype is needed by the underlying middleware, the factory checks for either a response instance returned, or a callable; in the latter case, it invokes the callable to retrieve a new response instance to inject.
It also adds a
ConfigProvider
class mapping each of the above middleware, and exposes it to zend-component-installer via the package definition.This patch builds on #54 and #55; merge only after those packages have been merged.