DataContext   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 5
c 1
b 0
f 0
dl 0
loc 28
ccs 8
cts 10
cp 0.8
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 3 1
A getColumn() 0 3 1
A __construct() 0 6 1
A getIndex() 0 3 1
A getKey() 0 3 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