Code Duplication    Length = 46-47 lines in 2 locations

src/Console/Commands/InstallCommand.php 1 location

@@ 7-52 (lines=46) @@
4
5
use Illuminate\Contracts\Container\Container;
6
7
class InstallCommand extends AbstractInitializeCommand
8
{
9
    /**
10
     * The console command name.
11
     *
12
     * @var string
13
     */
14
    protected $name = 'app:install';
15
16
    /**
17
     * The console command description.
18
     *
19
     * @var string
20
     */
21
    protected $description = 'Install the application according to current environment';
22
23
    /**
24
     * Create a new command instance.
25
     *
26
     * @param  Illuminate\Contracts\Container\Container  $container
27
     * @return void
28
     */
29
    public function __construct(Container $container)
30
    {
31
        $this->signature = 'app:install
32
                            {--root : Run commands which requires root privileges}
33
                            {--o|options=* : Run commands for custom options'.$this->getOptionsConfig($container).'}';
34
35
        parent::__construct();
36
37
    }
38
    /**
39
     * Returns instance of Install class which defines initializing runner chain.
40
     *
41
     * {@inheritdoc}
42
     */
43
    protected function getInitializerInstance(Container $container)
44
    {
45
        return $container->make('app.installer');
46
    }
47
48
    protected function title(): string
49
    {
50
        return 'Application installation';
51
    }
52
}
53

src/Console/Commands/UpdateCommand.php 1 location

@@ 7-53 (lines=47) @@
4
5
use Illuminate\Contracts\Container\Container;
6
7
class UpdateCommand extends AbstractInitializeCommand
8
{
9
    /**
10
     * The console command name.
11
     *
12
     * @var string
13
     */
14
    protected $name = 'app:update';
15
16
    /**
17
     * The console command description.
18
     *
19
     * @var string
20
     */
21
    protected $description = 'Update the application according to current environment';
22
23
    /**
24
     * Create a new command instance.
25
     *
26
     * @param  Illuminate\Contracts\Container\Container  $container
27
     * @return void
28
     */
29
    public function __construct(Container $container)
30
    {
31
        $this->signature = 'app:update
32
                            {--root : Run commands which requires root privileges}
33
                            {--o|options=* : Run commands for custom options'.$this->getOptionsConfig($container).'}';
34
35
        parent::__construct();
36
37
    }
38
39
    /**
40
     * Returns instance of Update class which defines initializing runner chain.
41
     *
42
     * {@inheritdoc}
43
     */
44
    protected function getInitializerInstance(Container $container)
45
    {
46
        return $container->make('app.updater');
47
    }
48
49
    protected function title(): string
50
    {
51
        return 'Application update';
52
    }
53
}
54