Completed
Push — master ( 247ae6...f93a8c )
by Nicolas
03:59
created

UpdateCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 42.86%

Importance

Changes 0
Metric Value
dl 0
loc 40
ccs 3
cts 7
cp 0.4286
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fire() 0 6 1
A getArguments() 0 6 1
1
<?php
2
3
namespace Nwidart\Modules\Commands;
4
5
use Illuminate\Console\Command;
6
use Nwidart\Modules\Traits\ModuleCommandTrait;
7
use Symfony\Component\Console\Input\InputArgument;
8
9
class UpdateCommand extends Command
10
{
11
    use ModuleCommandTrait;
12
13
    /**
14
     * The console command name.
15
     *
16
     * @var string
17
     */
18
    protected $name = 'module:update';
19
20
    /**
21
     * The console command description.
22
     *
23
     * @var string
24
     */
25
    protected $description = 'Update dependencies for the specified module or for all modules.';
26
27
    /**
28
     * Execute the console command.
29
     */
30
    public function fire()
31
    {
32
        $this->laravel['modules']->update($name = $this->getModuleName());
33
34
        $this->info("Module [{$name}] updated successfully.");
35
    }
36
37
    /**
38
     * Get the console command arguments.
39
     *
40
     * @return array
41
     */
42 55
    protected function getArguments()
43
    {
44
        return array(
45 55
            array('module', InputArgument::OPTIONAL, 'The name of module will be updated.'),
46 55
        );
47
    }
48
}
49