PublishThemeAssetsCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fire() 0 10 2
A getArguments() 0 6 1
1
<?php namespace Modules\Core\Console;
2
3
use Illuminate\Console\Command;
4
use Symfony\Component\Console\Input\InputArgument;
5
6
class PublishThemeAssetsCommand extends Command
7
{
8
    protected $name = 'asgard:publish:theme';
9
    protected $description = 'Publish theme assets';
10
11
    public function fire()
12
    {
13
        $theme = $this->argument('theme', null);
0 ignored issues
show
Unused Code introduced by
The call to PublishThemeAssetsCommand::argument() has too many arguments starting with null.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
14
15
        if (!empty($theme)) {
16
            $this->call('stylist:publish', ['theme' => $this->argument('theme')]);
17
        } else {
18
            $this->call('stylist:publish');
19
        }
20
    }
21
22
    protected function getArguments()
23
    {
24
        return [
25
            ['theme', InputArgument::OPTIONAL, 'Name of the theme you wish to publish']
26
        ];
27
    }
28
}
29