Issues (17)

Attribute/SubscribeDoctrineEvents.php (1 issue)

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
The condition is_array($values) is always true.
Loading history...
27
28
        $this->events = array_filter($this->events);
29
    }
30
}
31