Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Use response facttories in ErrorHandler and NotFoundHandler #153

Merged
merged 5 commits into from
Feb 22, 2018
Merged

Use response facttories in ErrorHandler and NotFoundHandler #153

merged 5 commits into from
Feb 22, 2018

Conversation

michalbundyra
Copy link
Member

No description provided.

Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, and are as we discussed. I marked a couple additional changes for type safety, and will push those changes to your branch momentarily.

Additionally, I'll provide migration notes.

{
$this->responsePrototype = $responsePrototype;
$this->responseFactory = function () use ($responseFactory) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a return typehint if decorating it is to be useful.

{
$this->responsePrototype = $responsePrototype;
$this->responseFactory = $responseFactory;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should be decorated with a closure as well.

composer.json Outdated
@@ -20,7 +20,7 @@
},
"require": {
"php": "^7.1",
"psr/http-message": "^1.0",
"fig/http-message-util": "^1.1.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand these particular changes.

  • We depend directly on psr/http-message; removing it doesn't make sense.
  • I'm unclear what the update to http-message-util 1.1.2 has to do with the changes in this patch.

Reinstates the `psr/http-message` requirement, as this is a direct
dependency.

Modifies the `fig/http-message-util` requirement to be `^1.1`, as that
is the release that adds the `StatusCodeInterface`; we don't use any
specifics from the later releases to make pinning to a later version
necessary.
Updates the `$responseFactory` property of the `ErrorHandler` to add a
return type hint, ensuring return type safety of the composed callable.

Wraps the `$responseFactory` property of the `NotFoundHandler` in a
callable, to ensure return type safety of the composed callable.
@weierophinney weierophinney merged commit df4c8a0 into zendframework:release-3.0.0 Feb 22, 2018
weierophinney added a commit that referenced this pull request Feb 22, 2018
@weierophinney
Copy link
Member

Thanks, @webimpress.

@michalbundyra michalbundyra deleted the response-factory branch February 22, 2018 23:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants