Completed
Push — master ( 67c7d1...f02869 )
by Nicolas
02:52
created

SentryInstaller::getHashedPassword()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php namespace Modules\Core\Console\Installers\Scripts\UserProviders;
2
3
use Modules\Core\Console\Installers\SetupScript;
4
5
class SentryInstaller extends ProviderInstaller implements SetupScript
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $driver = 'Sentry';
11
12
    /**
13
     * Check if the user driver is correctly registered.
14
     * @return bool
15
     */
16
    public function checkIsInstalled()
17
    {
18
        return class_exists('Cartalyst\Sentry\SentryServiceProvider');
19
    }
20
21
    /**
22
     * Not called
23
     * @return mixed
24
     */
25
    public function composer()
26
    {
27
        $this->application->register('Cartalyst\Sentry\SentryServiceProvider');
28
    }
29
30
    /**
31
     * @return mixed
32
     */
33 View Code Duplication
    public function publish()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
34
    {
35
        if ($this->command->option('verbose')) {
36
            return $this->command->call('vendor:publish', ['--provider' => 'Cartalyst\Sentry\SentryServiceProvider']);
37
        }
38
39
        return $this->command->callSilent('vendor:publish', ['--provider' => 'Cartalyst\Sentry\SentryServiceProvider']);
40
    }
41
42
    /**
43
     * @return mixed
44
     */
45
    public function migrate()
46
    {
47
        if ($this->command->option('verbose')) {
48
            return $this->command->call('migrate');
49
        }
50
51
        return $this->command->callSilent('migrate');
52
    }
53
54
    /**
55
     * @return mixed
56
     */
57
    public function configure()
58
    {
59
        $this->replaceCartalystUserModelConfiguration(
60
            'Cartalyst\Sentry\Users\Eloquent\User',
61
            $this->driver
62
        );
63
64
        $this->bindUserRepositoryOnTheFly('Sentry');
65
    }
66
67
    /**
68
     * @return mixed
69
     */
70 View Code Duplication
    public function seed()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
71
    {
72
        if ($this->command->option('verbose')) {
73
            return $this->command->call('db:seed', ['--class' => 'Modules\User\Database\Seeders\SentryGroupSeedTableSeeder']);
74
        }
75
76
        return $this->command->callSilent('db:seed', ['--class' => 'Modules\User\Database\Seeders\SentryGroupSeedTableSeeder']);
77
    }
78
79
    /**
80
     * @param $password
81
     * @return mixed
82
     */
83
    public function getHashedPassword($password)
84
    {
85
        return $password;
86
    }
87
}
88