Skip to content

avoid confusion about request #158

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

Merged
merged 1 commit into from
Oct 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions plugins/build-your-own.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ This interface defines the ``handleRequest`` method that allows to modify behavi
*/
public function handleRequest(RequestInterface $request, callable $next, callable $first);

The ``$request`` comes from an upstream plugin or Plugin Client itself.
The ``$request`` comes from an upstream plugin or ``PluginClient`` itself.
You can replace it and pass a new version downstream if you need.

.. note::

Be aware that the request is immutable.

The ``$next`` callable is the next plugin in the execution chain. When you need to call it, you must pass the ``$request``
as the first argument of this callable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i found this mostly confusing. i can't tell what we wanted to say with this. we say that you can replace the request for a new version that you pass downstream. what else is there to say? the note made me wonder if the request would not be allowed to be changed.

Copy link
Member

Choose a reason for hiding this comment

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

I guess it is just a gental reminder that you can to:

$request->withAddedHeader('Foo', 'Bar');

Im okey with removing it.

Expand Down