GdprEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
/*
4
 * This file is part of the 2amigos/yii2-usuario project.
5
 *
6
 * (c) 2amigOS! <http://2amigos.us/>
7
 *
8
 * For the full copyright and license information, please view
9
 * the LICENSE file that was distributed with this source code.
10
 */
11
12
namespace Da\User\Event;
13
14
use Da\User\Model\User;
15
use yii\base\Event;
16
17
/**
18
 * @property-read User $user
19
 */
20
class GdprEvent extends Event
21
{
22
    const EVENT_BEFORE_DELETE = 'beforeDelete';
23
    const EVENT_AFTER_DELETE = 'afterDelete';
24
    /**
25
     * @var bool whether logic must continue after this event. Valid only for beforeDelete
26
     */
27
    public $isValid = true;
28
29
    protected $user;
30
31 1
    public function __construct(User $user, array $config = [])
32
    {
33 1
        $this->user = $user;
34 1
        parent::__construct($config);
35 1
    }
36
37
    public function getUser()
38
    {
39
        return $this->user;
40
    }
41
}
42