Completed
Push — master ( a54fa8...fcdb22 )
by Antonio
04:50
created

ResetPasswordEvent::getToken()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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\Form\RecoveryForm;
15
use Da\User\Model\Token;
16
use yii\base\Event;
17
18
class ResetPasswordEvent extends Event
19
{
20
    const EVENT_BEFORE_TOKEN_VALIDATE = 'beforeTokenValidate';
21
    const EVENT_AFTER_TOKEN_VALIDATE = 'afterTokenValidate';
22
    const EVENT_BEFORE_RESET = 'beforeReset';
23
    const EVENT_AFTER_RESET = 'afterReset';
24
25
    protected $form;
26
    protected $token;
27
28 1
    public function __construct(Token $token = null, RecoveryForm $form = null, array $config = [])
29
    {
30 1
        $this->form = $form;
31 1
        $this->token = $token;
32
33 1
        parent::__construct($config);
34 1
    }
35
36
    public function getForm()
37
    {
38
        return $this->form;
39
    }
40
41 1
    public function getToken()
42
    {
43 1
        return $this->token;
44
    }
45
46 1
    public function updateForm(RecoveryForm $form)
47
    {
48 1
        return new static($this->getToken(), $form);
49
    }
50
}
51