UnknownCacheStrategyException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 3
c 2
b 0
f 1
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace hamburgscleanest\GuzzleAdvancedThrottle\Exceptions;
4
5
use hamburgscleanest\GuzzleAdvancedThrottle\Cache\Interfaces\CacheStrategy;
6
use hamburgscleanest\GuzzleAdvancedThrottle\Helpers\InterfaceHelper;
7
8
class UnknownCacheStrategyException extends \RuntimeException
9
{
10 2
    public function __construct(string $cacheStrategy, array $additionalStrategies = [])
11
    {
12 2
        parent::__construct(
13 2
            'Unknown cache strategy "' . $cacheStrategy . '".' . \PHP_EOL .
14 2
                'Available adapters: ' . \implode(', ', $additionalStrategies + InterfaceHelper::getImplementations(CacheStrategy::class))
15
        );
16 2
    }
17
}
18