Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function handle($request, Closure $next) |
||
22 | { |
||
23 | $response = $next($request); |
||
24 | |||
25 | // This step is only needed if you are returning |
||
26 | // a view in your Controller or elsewhere, because |
||
27 | // when returning a view `$next($request)` returns |
||
28 | // a View object, not a Response object, so we need |
||
29 | // to wrap the View back in a Response. |
||
30 | if (! $response instanceof SymfonyResponse) { |
||
31 | $response = new Response($response); |
||
32 | } |
||
33 | |||
34 | $response->headers->set('Pragma', 'no-cache'); |
||
35 | $response->headers->set('Expires', 'Sat, 01-Jan-2000 00:00:00 GMT'); |
||
36 | $response->headers->set('Cache-Control', 'private, no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0, s-maxage=0'); |
||
37 | |||
38 | return $response; |
||
39 | } |
||
40 | } |
||
41 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.