Completed
Pull Request — master (#289)
by Gavin
06:17
created

Noop::purge()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 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\BanInterface;
15
use FOS\HttpCache\ProxyClient\Invalidation\PurgeInterface;
16
use FOS\HttpCache\ProxyClient\Invalidation\RefreshInterface;
17
use FOS\HttpCache\ProxyClient\Invalidation\TagsInterface;
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 ProxyClientInterface, BanInterface, PurgeInterface, RefreshInterface, TagsInterface
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 getTagsHeaderValue(array $tags)
55
    {
56 1
        return [];
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62 1
    public function getTagsHeaderName()
63
    {
64 1
        return 'X-Noop-Cache-Tags';
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70 1
    public function purge($url, array $headers = [])
71
    {
72 1
        return $this;
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78 1
    public function refresh($url, array $headers = [])
79
    {
80 1
        return $this;
81
    }
82
83
    /**
84
     * {@inheritdoc}
85
     */
86 1
    public function flush()
87
    {
88 1
        return 0;
89
    }
90
}
91