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

NoCache::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 1
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
}