-
Notifications
You must be signed in to change notification settings - Fork 196
Removes concept of "default handler" #546
Removes concept of "default handler" #546
Conversation
Removes the zendframework#543 entry indicating the changed `NotFoundDelegate`, instead adding a "Removed" entry for that class. Updates the "Changed" entry for the `NotFoundMiddleware` to indicate its new constructor arguments.
|
||
class NotFoundMiddleware implements MiddlewareInterface | ||
{ | ||
const TEMPLATE_DEFAULT = 'error::404'; | ||
const LAYOUT_DEFAULT = 'layout::default'; |
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.
Can we set visibility for the constants please?
test/ConfigProviderTest.php
Outdated
@@ -38,7 +37,7 @@ public function testProviderDefinesExpectedAliases() | |||
{ | |||
$config = $this->provider->getDependencies(); | |||
$aliases = $config['aliases']; | |||
$this->assertArrayHasKey(Handler\DefaultHandler::class, $aliases); | |||
$this->assertArrayHasKey('Zend\Expressive\Delegate\DefaultDelegate', $aliases); |
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.
In ConfigProvider
we are using ::class
notation. I will do the same here.
$container->get(NotFoundHandler::class)->willReturn($handler); | ||
$factory = new NotFoundMiddlewareFactory(); | ||
$this->container = $this->prophesize(ContainerInterface::class); | ||
$this->response = $this->prophesize(ResponseInterface::class)->reveal(); |
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'll move this line before $this->container
to have container configuration together.
And I would add private
property in the class.
d529c32
to
6c14c1e
Compare
Removes the zendframework#543 entry indicating the changed `NotFoundDelegate`, instead adding a "Removed" entry for that class. Updates the "Changed" entry for the `NotFoundMiddleware` to indicate its new constructor arguments.
Because the `MiddlewarePipe` does not compose a "default handler", and because the `MiddlewarePipe` is what the request handler runner dispatches, there is no longer a concept of a "default delegate" (v2) or "default handler" (v3); there is only middleware. As such, this patch merges the `NotFoundHandler` into the `NotFoundMiddleware`. A key is kept for the `DefaultDelegate` service, but it will now resolve to the `NotFoundMiddleware`. Fixes zendframework#441.
Removes the zendframework#543 entry indicating the changed `NotFoundDelegate`, instead adding a "Removed" entry for that class. Updates the "Changed" entry for the `NotFoundMiddleware` to indicate its new constructor arguments.
- Adds property for `$response` - Alters order of operations in `setUp` for consistency
6c14c1e
to
ba80db2
Compare
CHANGELOG.md
Outdated
@@ -97,18 +97,19 @@ All notable changes to this project will be documented in this file, in reverse | |||
|
|||
and removes the dependency http-interop/http-server-middleware. | |||
|
|||
- [#543](https://github.com/zendframework/zend-expressive/pull/543) renames | |||
- [#543](https://github.com/zendframework/zend-expressive/pull/543) and | |||
[#546](https://github.com/zendframework/zend-expressive/pull/546) renames the |
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.
This change is in 3.0.0alpha2
changelog but milestone for this PR is set to 3.0.0alpha3
.
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.
Crap, you're right. I'll update.
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.
Essentially, I'll be merging all the alpha logs to a single 3.0.0 log later, but for now, needs to be slightly different.
Because the
MiddlewarePipe
does not compose a "default handler", and because theMiddlewarePipe
is what the request handler runner dispatches, there is no longer a concept of a "default delegate" (v2) or "default handler" (v3); there is only middleware.As such, this patch merges the
NotFoundHandler
into theNotFoundMiddleware
.A key is kept for the
DefaultDelegate
service, but it will now resolve to theNotFoundMiddleware
.Fixes #441.