Completed
Pull Request — master (#289)
by Gavin
35:03 queued 22:50
created

Noop::banPath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 3
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
 * This is a no operation client, its only purpose is to provide an implementation for use in an enviroments that
24
 * have no proxy to use.
25
 *
26
 * @author Gavin Staniforth <[email protected]>
27
 */
28
class Noop implements ProxyClientInterface, BanInterface, PurgeInterface, RefreshInterface, TagsInterface
29
{
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function ban(array $headers)
34
    {
35
        return $this;
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function banPath($path, $contentType = null, $hosts = null)
42
    {
43
        return $this;
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function invalidateTags(array $tags)
50
    {
51
        return $this;
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function getTagsHeaderValue(array $tags)
58
    {
59
        return [];
60
    }
61
62
    /**
63
     * {@inheritdoc}
64
     */
65
    public function getTagsHeaderName()
66
    {
67
        return 'X-Noop-Cache-Tags';
68
    }
69
70
    /**
71
     * {@inheritdoc}
72
     */
73
    public function purge($url, array $headers = [])
74
    {
75
        return $this;
76
    }
77
78
    /**
79
     * {@inheritdoc}
80
     */
81
    public function refresh($url, array $headers = [])
82
    {
83
        return $this;
84
    }
85
86
    /**
87
     * {@inheritdoc}
88
     */
89
    public function flush()
90
    {
91
        return 0;
92
    }
93
}
94