Completed
Pull Request — master (#6)
by Richan
11:44 queued 05:32
created

UncacheableByVarnish::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace RichanFongdasen\Varnishable\Middleware;
4
5
use Closure;
6
use Symfony\Component\HttpFoundation\Request;
7
8
class UncacheableByVarnish
9
{
10
    /**
11
     * Handle an incoming request.
12
     *
13
     * @param \Symfony\Component\HttpFoundation\Request $request
14
     * @param \Closure                                  $next
15
     *
16
     * @return mixed
17
     */
18
    public function handle(Request $request, Closure $next)
19
    {
20
        $response = $next($request);
21
22
        \Varnishable::addUncacheableHeader($response);
23
24
        return $response;
25
    }
26
}
27