Skip to content

Commit 723d9b3

Browse files
committed
add @wouterj catches
1 parent ee0fb1a commit 723d9b3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cookbook/event_dispatcher/before_after_filters.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ hash (with a salt using that token) to all our responses.
3838

3939
So, after generating a JSON response, this hash has to be added to the response.
4040

41-
Before and after filters with kernel.controller / kernel.response events
42-
------------------------------------------------------------------------
41+
Before and after filters with ``kernel.controller`` / ``kernel.response`` events
42+
--------------------------------------------------------------------------------
4343

4444
Basic Setup
4545
~~~~~~~~~~~
@@ -86,24 +86,24 @@ request needs token validation. Regarding the response, you will also need
8686
some way to identify that the response needs to be hashed.
8787

8888
A clean and easy way is to create an empty interface and make the controllers
89-
implement it:
89+
implement it::
9090

9191
namespace Acme\DemoBundle\Controller;
9292

9393
interface TokenAuthenticatedController
9494
{
95-
// Nothing here
95+
// ...
9696
}
9797

98-
And also create a HashedResponse object extending Response
98+
And also create a ``HashedResponse`` object extending ``Response``
9999

100100
namespace Acme\DemoBundle\Response;
101101

102102
use Symfony\Component\HttpFoundation\Response;
103103

104104
class HashedResponse extends Response
105105
{
106-
// Nothing here
106+
// ...
107107
}
108108

109109
A controller that implements this interface simply looks like this::
@@ -172,7 +172,7 @@ event listeners, you can learn more about them at :doc:`/cookbook/service_contai
172172
if ($response instanceof HashedResponse) {
173173
$token = $event->getRequest()->get('token');
174174

175-
$hash = sha1($response->getContent() . $token);
175+
$hash = sha1($response->getContent().$token);
176176

177177
$response->setContent(
178178
json_encode(array(

0 commit comments

Comments
 (0)