Conditions | 4 |
Paths | 8 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
28 | 60 | public function run(): bool |
|
29 | { |
||
30 | 60 | $result = null; |
|
|
|||
31 | |||
32 | 60 | if ($this->runNow) { |
|
33 | 18 | $result = Container::getInstance()->make(Dispatcher::class)->dispatchNow($this->job); |
|
34 | } else { |
||
35 | 48 | $result = Container::getInstance()->make(Dispatcher::class)->dispatch($this->job); |
|
36 | } |
||
37 | |||
38 | 60 | $artisanCommand = $this->getArtisanCommnad(); |
|
39 | |||
40 | 60 | if ($artisanCommand->getOutput()->isVerbose()) { |
|
41 | 6 | $artisanCommand->getOutput()->newLine(); |
|
42 | 6 | $artisanCommand->info($result); |
|
43 | } |
||
44 | |||
45 | 60 | return ! (is_int($result) and $result > 0); |
|
46 | } |
||
47 | } |
||
48 |
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.