UpdateCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 42
rs 10
c 0
b 0
f 0

2 Methods

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