Completed
Pull Request — master (#299)
by David
67:30 queued 64:42
created

InvalidationController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
c 1
b 1
f 0
lcom 0
cbo 2
dl 0
loc 28
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A otherAction() 0 4 1
A itemAction() 0 4 1
A errorAction() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the FOSHttpCacheBundle package.
5
 *
6
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FOS\HttpCacheBundle\Tests\Functional\Fixtures\Controller;
13
14
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
15
use Symfony\Component\HttpFoundation\Response;
16
use FOS\HttpCacheBundle\Configuration\InvalidateRoute;
17
use FOS\HttpCacheBundle\Configuration\InvalidatePath;
18
19
class InvalidationController extends Controller
20
{
21
    /**
22
     * @InvalidateRoute("test_noncached")
23
     * @InvalidateRoute("test_cached", params={"id" = "myhardcodedid"})
24
     * @InvalidateRoute("tag_one", params={"id" = {"expression"="id"}})
25
     */
26
    public function itemAction($id)
27
    {
28
        return new Response("Done $id");
29
    }
30
31
    /**
32
     * @InvalidatePath("/cached")
33
     */
34
    public function otherAction($statusCode)
35
    {
36
        return new Response('Done.', $statusCode);
37
    }
38
39
    /**
40
     * @InvalidatePath("/somepath")
41
     */
42
    public function errorAction()
43
    {
44
        return new Response('Forbidden', 403);
45
    }
46
}
47