Passed
Push — master ( 07e920...c1e4c2 )
by Alexander
02:06
created

Event   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 4
c 1
b 0
f 0
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setData() 0 3 1
A __construct() 0 4 1
A getData() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Vasoft\VersionIncrement\Events;
6
7
class Event
8
{
9
    private array $data = [];
10
11 32
    public function __construct(
12
        public readonly EventType $eventType,
13
        public string $version = '',
14 32
    ) {}
15
16 9
    public function setData(string $name, mixed $value): void
17
    {
18 9
        $this->data[$name] = $value;
19
    }
20
21 9
    public function getData(string $name): mixed
22
    {
23 9
        return $this->data[$name] ?? null;
24
    }
25
}
26