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

CacheException::getKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 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