Completed
Pull Request — master (#251)
by
unknown
02:45
created

FormEvent::__construct()   A

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 yii\base\Event;
15
use yii\base\Model;
16
17
class FormEvent extends Event
18
{
19
    const EVENT_BEFORE_REQUEST = 'beforeRequest';
20
    const EVENT_AFTER_REQUEST = 'afterRequest';
21
    const EVENT_BEFORE_RESEND = 'beforeResend';
22
    const EVENT_AFTER_RESEND = 'afterResend';
23
    const EVENT_BEFORE_LOGIN = 'beforeLogin';
24
    const EVENT_AFTER_LOGIN = 'afterLogin';
25
    const EVENT_BEFORE_REGISTER = 'beforeRegister';
26
    const EVENT_AFTER_REGISTER = 'afterRegister';
27
28
    protected $form;
29
30 12
    public function __construct(Model $form, array $config = [])
31
    {
32 12
        $this->form = $form;
33 12
        parent::__construct($config);
34 12
    }
35
36
    public function getForm()
37
    {
38
        return $this->form;
39
    }
40
}
41