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

Response factories #561

Merged
merged 4 commits into from
Feb 21, 2018
Merged

Response factories #561

merged 4 commits into from
Feb 21, 2018

Conversation

michalbundyra
Copy link
Member

@michalbundyra michalbundyra commented Feb 21, 2018

Refactors the ResponseFactory to be a ResponseFactoryFactory. Any class that needs a response instance should compose a callable response factory instead, which can then be invoked in order to produce a response. This ensures we generate a new instance every time, and eliminates the need for mapping discrete "virtual" services to the response factory; we can use the same service everywhere.

The name chosen for the ResponseFactoryFactory service is the PSR-7 ResponseInterface; this allows us to use an existing name instead of a constant evaluating to an arbitrary string name.

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