Completed
Pull Request — master (#289)
by Gavin
16:24 queued 13:47
created

Noop::flush()   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 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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
use Http\Message\MessageFactory;
19
20
/**
21
 * Class Noop
22
 *
23
 * @author Gavin Staniforth <[email protected]>
24
 */
25
class Noop implements ProxyClientInterface, BanInterface, PurgeInterface, RefreshInterface, TagsInterface
26
{
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function ban(array $headers)
31
    {
32
        return $this;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function banPath($path, $contentType = null, $hosts = null)
39
    {
40
        return $this;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function invalidateTags(array $tags)
47
    {
48
        return $this;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function getTagsHeaderValue(array $tags)
55
    {
56
        return [];
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62
    public function getTagsHeaderName()
63
    {
64
        return 'X-Noop-Cache-Tags';
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function purge($url, array $headers = [])
71
    {
72
        return $this;
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function refresh($url, array $headers = [])
79
    {
80
        return $this;
81
    }
82
83
    /**
84
     * {@inheritdoc}
85
     */
86
    public function flush()
87
    {
88
        return 0;
89
    }
90
}
91