Completed
Pull Request — master (#335)
by Tobias
10:07
created

InvalidatePath::getAliasName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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\Configuration;
13
14
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationAnnotation;
15
16
/**
17
 * @Annotation
18
 */
19
class InvalidatePath extends ConfigurationAnnotation
20
{
21
    /**
22
     * @var array
23
     */
24
    private $paths;
25
26
    /**
27
     * Handle path given without explicit key.
28
     *
29
     * @param string $data
30
     */
31
    public function setValue($data)
32
    {
33
        $this->setPaths((is_array($data) ? $data : [$data]));
34
    }
35
36
    /**
37
     * @param array $paths
38
     */
39
    public function setPaths($paths)
40
    {
41
        $this->paths = $paths;
42
    }
43
44
    /**
45
     * @return array
46
     */
47
    public function getPaths()
48
    {
49
        return $this->paths;
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function getAliasName()
56
    {
57
        return 'invalidate_path';
58
    }
59
60
    /**
61
     * {@inheritdoc}
62
     */
63
    public function allowArray()
64
    {
65
        return true;
66
    }
67
}
68