UserMailHookEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
namespace Swm\Bundle\MailHookBundle\Event;
4
5
use Symfony\Component\EventDispatcher\Event;
6
use Symfony\Component\Security\Core\User\UserInterface;
7
8
class UserMailHookEvent extends MailHookEvent implements HookEventInterface
9
{
10
    /**
11
     * @var string
12
     */
13
    private $name;
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
14
15
    /**
16
     * @var UserInterface
17
     */
18
    private $user;
19
20
    /**
21
     * @var array Direct metadata from the mail provider
22
     */
23
    private $metaData;
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
24
25
    /**
26
     * @param string        $name
27
     * @param UserInterface $user
28
     * @param array         $metaData
29
     */
30
    public function __construct(UserInterface $user  = null, $name  = null, array $metaData = array())
31
    {
32
        $this->name     = $name;
33
        $this->user     = $user;
34
        $this->metaData = $metaData;
35
    }
36
37
    /**
38
     * Gets the value of user.
39
     *
40
     * @return UserInterface
41
     */
42
    public function getUser()
43
    {
44
        return $this->user;
45
    }
46
47
    /**
48
     * Sets the value of user.
49
     *
50
     * @param UserInterface $user the user
51
     *
52
     * @return this
53
     */
54
    public function setUser(UserInterface $user)
55
    {
56
        $this->user = $user;
57
58
        return $this;
59
    }
60
}
61