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

InvalidationController::errorAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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