Passed
Push — master ( 3646da...aa9f24 )
by Andrea
16:20
created

CacheClearer::clear()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Cdf\BiCoreBundle\Cache;
4
5
use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface;
6
use Symfony\Component\Cache\Simple\FilesystemCache;
7
8
class CacheClearer implements CacheClearerInterface
9
{
10 1
    public function clear($cacheDirectory)
11
    {
12
        //Qui si possono mettere operazioni da fare in caso di clear cache
13 1
        $cache = new FilesystemCache();
14 1
        if ($cache->has('git_tag')) {
15 1
            $cache->delete('git_tag');
16 1
            $cache->clear();
17
        }
18 1
    }
19
}
20