Passed
Pull Request — master (#18)
by Alex
06:24 queued 03:24
created

AbstractEvent::setParameters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arp\EventDispatcher\Event;
6
7
/**
8
 * @author  Alex Patterson <[email protected]>
9
 * @package Arp\EventDispatcher\Event
10
 */
11
abstract class AbstractEvent implements ParametersAwareInterface
12
{
13
    use ParametersAwareTrait;
14
15
    /**
16
     * @param ParametersInterface<mixed>|array<mixed>|mixed $params
17
     */
18 4
    public function __construct($params = [])
19
    {
20 4
        if (!$params instanceof ParametersInterface) {
21 4
            $params = new Parameters(is_array($params) ? $params : []);
0 ignored issues
show
introduced by
The condition is_array($params) is always true.
Loading history...
22
        }
23
24 4
        $this->setParameters($params);
25
    }
26
}
27