ValueDependency::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 0
c 1
b 1
f 0
dl 0
loc 2
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Cache\Dependency;
6
7
use Yiisoft\Cache\CacheInterface;
8
9
/**
10
 * ValueDependency represents a dependency based on the specified value in the constructor.
11
 *
12
 * The dependency is reported as unchanged if and only if the specified value is
13
 * the same as the one evaluated when storing the data to cache.
14
 */
15
final class ValueDependency extends Dependency
16
{
17
    public function __construct(private mixed $value)
18
    {
19 8
    }
20
21 8
    protected function generateDependencyData(CacheInterface $cache): mixed
22
    {
23
        return $this->value;
24 8
    }
25
}
26