NoCache::__construct()   A
last analyzed

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 2
Bugs 0 Features 1
Metric Value
eloc 0
c 2
b 0
f 1
dl 0
loc 2
ccs 1
cts 1
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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
class NoCache implements CacheStrategy
11
{
12 10
    public function __construct(StorageInterface $storage = null)
13
    {
14
        // No caching, so don't do anything with the storage..
15 10
    }
16
17 5
    public function request(RequestInterface $request, callable $handler): PromiseInterface
18
    {
19 5
        return $handler();
20
    }
21
}
22