Completed
Push — master ( 3d8aa7...80558b )
by Timo
02:25
created

NoCache   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A request() 0 3 1
A __construct() 0 2 1
1
<?php
2
3
namespace hamburgscleanest\GuzzleAdvancedThrottle\Cache\Strategies;
4
5
use GuzzleHttp\Promise\PromiseInterface;
6
use hamburgscleanest\GuzzleAdvancedThrottle\Cache\Interfaces\CacheStrategy;
7
use hamburgscleanest\GuzzleAdvancedThrottle\Cache\Interfaces\StorageInterface;
8
use Psr\Http\Message\RequestInterface;
9
10
/**
11
 * Class NoCache
12
 * @package hamburgscleanest\GuzzleAdvancedThrottle\Cache\Strategies
13
 */
14
class NoCache implements CacheStrategy
15
{
16
17
    /**
18
     * NoCache constructor.
19
     * @param null|StorageInterface $storage
20
     */
21 1
    public function __construct(StorageInterface $storage = null)
22
    {
23
        // No caching, so don't do anything with the storage..
24 1
    }
25
26
    /**
27
     * @param RequestInterface $request
28
     * @param callable $handler
29
     * @return PromiseInterface
30
     */
31 1
    public function request(RequestInterface $request, callable $handler) : PromiseInterface
32
    {
33 1
        return $handler();
34
    }
35
}