Noop::ban()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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\ClearCapable;
16
use FOS\HttpCache\ProxyClient\Invalidation\PurgeCapable;
17
use FOS\HttpCache\ProxyClient\Invalidation\RefreshCapable;
18
use FOS\HttpCache\ProxyClient\Invalidation\TagCapable;
19
20
/**
21
 * This client implements the interfaces but does nothing.
22
 *
23
 * It is useful when testing code that needs a ProxyClient, or to configure in
24
 * environments that have no caching proxy to talk to, like a local development
25
 * setup.
26
 *
27
 * @author Gavin Staniforth <[email protected]>
28
 */
29
class Noop implements ProxyClient, BanCapable, PurgeCapable, RefreshCapable, TagCapable, ClearCapable
30
{
31
    /**
32
     * {@inheritdoc}
33
     */
34 1
    public function ban(array $headers)
35
    {
36 1
        return $this;
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42 1
    public function banPath($path, $contentType = null, $hosts = null)
43
    {
44 1
        return $this;
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50 1
    public function invalidateTags(array $tags)
51
    {
52 1
        return $this;
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58 1
    public function purge($url, array $headers = [])
59
    {
60 1
        return $this;
61
    }
62
63
    /**
64
     * {@inheritdoc}
65
     */
66 1
    public function refresh($url, array $headers = [])
67
    {
68 1
        return $this;
69
    }
70
71
    /**
72
     * {@inheritdoc}
73
     */
74 1
    public function flush()
75
    {
76 1
        return 0;
77
    }
78
79
    /**
80
     * {@inheritdoc}
81
     */
82
    public function clear()
83
    {
84
        return $this;
85
    }
86
}
87