Passed
Pull Request — master (#85)
by BENOIT
03:47
created

NullCacheStrategy   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 27
ccs 4
cts 6
cp 0.6667
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fetch() 0 4 1
A cache() 0 4 1
A update() 0 4 1
1
<?php
2
3
namespace Kevinrob\GuzzleCache\Strategy;
4
5
use Kevinrob\GuzzleCache\CacheEntry;
6
use Psr\Http\Message\RequestInterface;
7
use Psr\Http\Message\ResponseInterface;
8
9
class NullCacheStrategy implements CacheStrategyInterface
10
{
11
12
    /**
13
     * @inheritDoc
14
     */
15 2
    public function fetch(RequestInterface $request)
16
    {
17 2
        return null;
18
    }
19
20
    /**
21
     * @inheritDoc
22
     */
23 2
    public function cache(RequestInterface $request, ResponseInterface $response)
24
    {
25 2
        return true;
26
    }
27
28
    /**
29
     * @inheritDoc
30
     */
31
    public function update(RequestInterface $request, ResponseInterface $response)
32
    {
33
        return true;
34
    }
35
}
36