ValueDependency::generateDependencyData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

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