DataContext::getKey()   A
last analyzed

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 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
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\Yii\DataView\Column\Base;
6
7
use Yiisoft\Yii\DataView\Column\ColumnInterface;
8
9
final class DataContext
10
{
11 76
    public function __construct(
12
        private ColumnInterface $column,
13
        private array|object $data,
14
        private mixed $key,
15
        private int $index,
16
    ) {
17 76
    }
18
19
    public function getColumn(): ColumnInterface
20
    {
21
        return $this->column;
22
    }
23
24 75
    public function getData(): array|object
25
    {
26 75
        return $this->data;
27
    }
28
29 28
    public function getKey(): mixed
30
    {
31 28
        return $this->key;
32
    }
33
34 30
    public function getIndex(): int
35
    {
36 30
        return $this->index;
37
    }
38
}
39