UpdateCommand::fire()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
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