Passed
Pull Request — master (#514)
by Fabien
10:39
created

Noop   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 48
ccs 12
cts 12
cp 1
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidateTags() 0 3 1
A refresh() 0 3 1
A ban() 0 3 1
A flush() 0 3 1
A banPath() 0 3 1
A purge() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the FOSHttpCache 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\HttpCache\ProxyClient;
13
14
use FOS\HttpCache\ProxyClient\Invalidation\BanCapable;
15
use FOS\HttpCache\ProxyClient\Invalidation\PurgeCapable;
16
use FOS\HttpCache\ProxyClient\Invalidation\RefreshCapable;
17
use FOS\HttpCache\ProxyClient\Invalidation\TagCapable;
18
19
/**
20
 * This is a no operation client, its only purpose is to provide an implementation for use in an enviroments that
21
 * have no proxy to use.
22
 *
23
 * @author Gavin Staniforth <[email protected]>
24
 */
25
class Noop implements ProxyClient, BanCapable, PurgeCapable, RefreshCapable, TagCapable
26
{
27
    /**
28
     * {@inheritdoc}
29
     */
30 1
    public function ban(array $headers)
31
    {
32 1
        return $this;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38 1
    public function banPath($path, $contentType = null, $hosts = null)
39
    {
40 1
        return $this;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46 1
    public function invalidateTags(array $tags)
47
    {
48 1
        return $this;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54 1
    public function purge($url, array $headers = [])
55
    {
56 1
        return $this;
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62 1
    public function refresh($url, array $headers = [])
63
    {
64 1
        return $this;
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70 1
    public function flush()
71
    {
72 1
        return 0;
73
    }
74
}
75