LoginForm   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 16 1
1
<?php
2
3
/**
4
 * LoginForm
5
 * @copyright Copyright (c) 2011 - 2014 Aleksandr Torosh (http://wezoom.com.ua)
6
 * @author Aleksandr Torosh <[email protected]>
7
 */
8
9
namespace Admin\Form;
10
11
use Phalcon\Forms\Element\Text;
12
use Phalcon\Forms\Element\Password;
13
use Phalcon\Validation\Validator\PresenceOf;
14
15
class LoginForm extends \Phalcon\Forms\Form
16
{
17
18
    public function initialize()
19
    {
20
        $login = new Text('login', array(
21
            'required' => true,
22
            'placeholder' => 'Enter login',
23
        ));
24
        $login->addValidator(new PresenceOf(array('message' => 'Login is required')));
25
        $this->add($login);
26
27
        $password = new Password('password', array(
28
            'required' => true,
29
        ));
30
        $password->addValidator(new PresenceOf(array('message' => 'Password is required')));
31
        $this->add($password);
32
33
    }
34
35
}
36