AbstractEvent::__construct()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
ccs 2
cts 2
cp 1
rs 10
cc 3
nc 2
nop 1
crap 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\EventDispatcher\Event;
6
7
abstract class AbstractEvent implements ParametersAwareInterface
8
{
9
    use ParametersAwareTrait;
10
11
    /**
12
     * @param ParametersInterface<mixed>|iterable<mixed> $params
13
     */
14
    public function __construct(iterable $params = [])
15
    {
16
        if (!$params instanceof ParametersInterface) {
17
            $params = new Parameters(is_array($params) ? $params : []);
18 4
        }
19
20 4
        $this->setParameters($params);
21 4
    }
22
}
23