LRUCacheItem::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace CHMLib\LZX;
4
5
/**
6
 * Represent an cached item handled by LRUCache.
7
 */
8
class LRUCacheItem
9
{
10
    /**
11
     * The item value.
12
     *
13
     * @var mixed
14
     */
15
    public $value;
16
17
    /**
18
     * The item hit count.
19
     *
20
     * @var int
21
     */
22
    public $hits;
23
24
    /**
25
     * Initializes the instance.
26
     *
27
     * @param mixed $value The item value.
28
     */
29 26
    public function __construct($value)
30
    {
31 26
        $this->value = $value;
32 26
        $this->hits = 1;
33 26
    }
34
}
35