Completed
Pull Request — master (#289)
by Gavin
13:41
created

Noop::ban()   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 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
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
     * NoopClient constructor.
29
     *
30
     * @param array $servers
31
     * @param array $options
32
     * @param null $httpClient
33
     * @param null $messageFactory
34
     * @param null $uriFactory
35
     */
36
    public function __construct(
37
        array $servers,
0 ignored issues
show
Unused Code introduced by
The parameter $servers is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
38
        array $options = [],
0 ignored issues
show
Unused Code introduced by
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
39
        $httpClient = null,
0 ignored issues
show
Unused Code introduced by
The parameter $httpClient is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
40
        $messageFactory = null,
0 ignored issues
show
Unused Code introduced by
The parameter $messageFactory is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
41
        $uriFactory = null
0 ignored issues
show
Unused Code introduced by
The parameter $uriFactory is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
42
    )
43
    {
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function ban(array $headers)
50
    {
51
        return $this;
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function banPath($path, $contentType = null, $hosts = null)
58
    {
59
        return $this;
60
    }
61
62
63
    /**
64
     * {@inheritdoc}
65
     */
66
    public function invalidateTags(array $tags)
67
    {
68
        return $this;
69
    }
70
71
    /**
72
     * {@inheritdoc}
73
     */
74
    public function getTagsHeaderValue(array $tags)
75
    {
76
        return [];
77
    }
78
79
    /**
80
     * {@inheritdoc}
81
     */
82
    public function getTagsHeaderName()
83
    {
84
        return 'X-Noop-Cache-Tags';
85
    }
86
87
    /**
88
     * {@inheritdoc}
89
     */
90
    public function purge($url, array $headers = [])
91
    {
92
        return $this;
93
    }
94
95
    /**
96
     * {@inheritdoc}
97
     */
98
    public function refresh($url, array $headers = [])
99
    {
100
        return $this;
101
    }
102
103
    /**
104
     * {@inheritdoc}
105
     */
106
    public function flush()
107
    {
108
        return 0;
109
    }
110
}
111