ParametersAwareTrait   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getParameters() 0 3 1
A setParam() 0 3 1
A getParam() 0 3 1
A setParameters() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\EventDispatcher\Event;
6
7
trait ParametersAwareTrait
8
{
9
    protected ParametersInterface $params;
10
11
    public function setParameters(ParametersInterface $params): void
12
    {
13
        $this->params = $params;
14
    }
15
16
    public function getParameters(): ParametersInterface
17
    {
18
        return $this->params;
19
    }
20
21
    public function getParam(string $name, mixed $default = null): mixed
22
    {
23 4
        return $this->params->getParam($name, $default);
24
    }
25 4
26
    public function setParam(string $name, mixed $value): void
27
    {
28
        $this->params->setParam($name, $value);
29
    }
30
}
31