ForgotPasswordFormFields   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 21 1
1
<?php namespace Anomaly\UsersModule\User\Password;
2
3
/**
4
 * Class ForgotPasswordFormFields
5
 *
6
 * @link          http://pyrocms.com/
7
 * @author        PyroCMS, Inc. <[email protected]>
8
 * @author        Ryan Thompson <[email protected]>
9
 */
10
class ForgotPasswordFormFields
11
{
12
13
    /**
14
     * Handle the fields.
15
     *
16
     * @param ForgotPasswordFormBuilder $builder
17
     */
18
    public function handle(ForgotPasswordFormBuilder $builder)
19
    {
20
        $builder->setFields(
21
            [
22
                'email' => [
23
                    'type'       => 'anomaly.field_type.email',
24
                    'label'      => 'anomaly.module.users::field.email.name',
25
                    'required'   => true,
26
                    'rules'      => [
27
                        'valid_email',
28
                    ],
29
                    'validators' => [
30
                        'valid_email' => [
31
                            'handler' => 'Anomaly\UsersModule\User\Validation\ValidateEmail@handle',
32
                            'message' => 'anomaly.module.users::message.invalid_email',
33
                        ],
34
                    ],
35
                ],
36
            ]
37
        );
38
    }
39
}
40