Completed
Pull Request — master (#289)
by Gavin
07:58
created

Noop   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 8
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 66
ccs 16
cts 16
cp 1
rs 10

8 Methods

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