Wrapper::offsetGet()   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 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Knp\DictionaryBundle\Dictionary;
6
7
use Knp\DictionaryBundle\Dictionary;
8
9
/**
10
 * @template E
11
 *
12
 * @implements Dictionary<E>
13
 */
14
abstract class Wrapper implements Dictionary
15
{
16
    /**
17
     * @param Dictionary<E> $dictionary
18
     */
19
    public function __construct(private readonly Dictionary $dictionary) {}
20
21
    public function getName(): string
22
    {
23 19
        return $this->dictionary->getName();
24
    }
25 19
26 19
    public function getValues(): array
27
    {
28 4
        return $this->dictionary->getValues();
29
    }
30 4
31
    public function getKeys(): array
32
    {
33 6
        return $this->dictionary->getKeys();
34
    }
35 6
36
    public function offsetExists(mixed $offset): bool
37
    {
38 2
        return $this->dictionary->offsetExists($offset);
39
    }
40 2
41
    public function offsetGet(mixed $offset): mixed
42
    {
43 1
        return $this->dictionary->offsetGet($offset);
44
    }
45 1
46
    public function offsetSet(mixed $offset, mixed $value): void
47
    {
48 3
        $this->dictionary->offsetSet($offset, $value);
49
    }
50 3
51
    public function offsetUnset(mixed $offset): void
52
    {
53 1
        $this->dictionary->offsetUnset($offset);
54
    }
55 1
56 1
    public function count(): int
57
    {
58 1
        return $this->dictionary->count();
59
    }
60 1
61 1
    /**
62
     * @return Dictionary<E>
63 1
     */
64
    public function getIterator(): Dictionary
65 1
    {
66
        return $this->dictionary;
67
    }
68
}
69