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