Passed
Push — master ( ab102c...5f4e36 )
by Alexander
02:10
created

CacheException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getKey() 0 3 1
A __construct() 0 4 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
    private string $key;
13
14 4
    public function __construct(string $key, string $message = '', int $code = 0, Throwable $previous = null)
15
    {
16 4
        $this->key = $key;
17 4
        parent::__construct($message, $code, $previous);
18 4
    }
19
20 2
    public function getKey(): string
21
    {
22 2
        return $this->key;
23
    }
24
}
25