Conditions | 4 |
Paths | 8 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
30 | 60 | public function run(): bool |
|
31 | { |
||
32 | 60 | $result = null; |
|
|
|||
33 | |||
34 | 60 | if ($this->runNow) { |
|
35 | 18 | $result = Container::getInstance()->make(Dispatcher::class)->dispatchNow($this->job); |
|
36 | } else { |
||
37 | 48 | $result = Container::getInstance()->make(Dispatcher::class)->dispatch($this->job); |
|
38 | } |
||
39 | |||
40 | 60 | $artisanCommand = $this->getArtisanCommnad(); |
|
41 | |||
42 | 60 | if ($artisanCommand->getOutput()->isVerbose()) { |
|
43 | 6 | $artisanCommand->getOutput()->newLine(); |
|
44 | 6 | $artisanCommand->info($result); |
|
45 | } |
||
46 | |||
47 | 60 | return ! (is_int($result) and $result > 0); |
|
48 | } |
||
49 | } |
||
50 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.