SetOptions::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php namespace Anomaly\UsersModule\User\Password\Command;
2
3
use Anomaly\UsersModule\User\Password\ForgotPasswordFormBuilder;
4
use Illuminate\Contracts\Config\Repository;
5
6
/**
7
 * Class SetDefaultOptions
8
 *
9
 * @link          http://pyrocms.com/
10
 * @author        PyroCMS, Inc. <[email protected]>
11
 * @author        Ryan Thompson <[email protected]>
12
 */
13
class SetOptions
14
{
15
16
    /**
17
     * The reset form builder.
18
     *
19
     * @var ForgotPasswordFormBuilder
20
     */
21
    protected $builder;
22
23
    /**
24
     * Create a new SetDefaultOptions instance.
25
     *
26
     * @param ForgotPasswordFormBuilder $builder
27
     */
28
    public function __construct(ForgotPasswordFormBuilder $builder)
29
    {
30
        $this->builder = $builder;
31
    }
32
33
    /**
34
     * Handle the command.
35
     *
36
     * @param Repository $config
37
     */
38
    public function handle(Repository $config)
0 ignored issues
show
Unused Code introduced by
The parameter $config is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
39
    {
40
        if (!$this->builder->getOption('redirect')) {
41
            $this->builder->setOption('redirect', '/');
42
        }
43
44
        if (!$this->builder->getOption('success_message')) {
45
            $this->builder->setOption(
46
                'success_message',
47
                'You are now logged in.'
48
            );
49
        }
50
51
        if (!$this->builder->getOption('container_class')) {
52
            $this->builder->setOption('container_class', 'form-wrapper');
53
        }
54
    }
55
56
}
57