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