ResetPasswordFormCriteria   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A onInitialized() 0 10 3
1
<?php namespace Anomaly\UsersModule\User\Password;
2
3
use Anomaly\Streams\Platform\Ui\Form\FormCriteria;
4
use Illuminate\Contracts\Cache\Repository;
5
use Illuminate\Contracts\Encryption\Encrypter;
6
use Illuminate\Http\Request;
7
8
/**
9
 * Class ResetPasswordFormCriteria
10
 *
11
 * @link          http://pyrocms.com/
12
 * @author        PyroCMS, Inc. <[email protected]>
13
 * @author        Ryan Thompson <[email protected]>
14
 */
15
class ResetPasswordFormCriteria extends FormCriteria
16
{
17
18
    /**
19
     * Fired just before building.
20
     *
21
     * @param Encrypter $encrypter
22
     * @param Request   $request
23
     */
24
    public function onInitialized(Encrypter $encrypter, Request $request)
25
    {
26
        if ($code = $request->query('code')) {
27
            array_set($this->parameters, 'code', $encrypter->decrypt($code));
28
        }
29
30
        if ($email = $request->query('email')) {
31
            array_set($this->parameters, 'email', $encrypter->decrypt($email));
32
        }
33
    }
34
}
35