CacheException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 3
c 0
b 0
f 0
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getKey() 0 3 1
A __construct() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Cache\Exception;
6
7
use RuntimeException;
8
use Throwable;
9
10
abstract class CacheException extends RuntimeException implements \Psr\SimpleCache\CacheException
11
{
12
    public function __construct(
13
        private string $key,
14 4
        string $message = '',
15
        int $code = 0,
16 4
        Throwable $previous = null
17 4
    ) {
18
        parent::__construct($message, $code, $previous);
19
    }
20 2
21
    public function getKey(): string
22 2
    {
23
        return $this->key;
24
    }
25
}
26