SubscribeDoctrineEvents   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
1
<?php
2
3
/*
4
 * This file is part of the XiideaEasyAuditBundle package.
5
 *
6
 * (c) Xiidea <http://www.xiidea.net>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Xiidea\EasyAuditBundle\Attribute;
13
14
/**
15
 * Attribute for ORM Subscribed Event.
16
 *
17
 * @author Roni Saha <[email protected]>
18
 */
19
#[\Attribute(\Attribute::TARGET_CLASS)]
20
class SubscribeDoctrineEvents
21
{
22
    public array $events = [];
23
24
    public function __construct(array|string $values)
25
    {
26
        $this->events = is_array($values) ? $values : array_map('trim', explode(',', $values));
0 ignored issues
show
introduced by
The condition is_array($values) is always true.
Loading history...
27
28
        $this->events = array_filter($this->events);
29
    }
30
}
31