NoCache   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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
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