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

Event::setData()   A

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 2
crap 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