Completed
Push — master ( e75413...39c194 )
by Roni
14:44 queued 13:17
created

SubscribeDoctrineEvents   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 18
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 4
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\Annotation;
13
14
/**
15
 * Annotation for ORM Subscribed Event.
16
 *
17
 * @Annotation
18
 * @Target({"CLASS"})
19
 *
20
 * @author Roni Saha <[email protected]>
21
 */
22
/* @final */ class SubscribeDoctrineEvents
23
{
24
    public $events = array();
25
26
    public function __construct(array $values)
27
    {
28
        if (isset($values['value'])) {
29
            $values['events'] = $values['value'];
30
        }
31
        if (!isset($values['events'])) {
32
            return;
33
        }
34
35
        $this->events = is_array($values['events']) ? $values['events'] : array_map('trim', explode(',', $values['events']));
36
37
        $this->events = array_filter($this->events);
38
    }
39
}
40