| Conditions | 3 |
| Paths | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0987 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 54 | public function __invoke(): bool |
|
| 30 | { |
||
| 31 | return $this->artisanCommand->task($this->title(), function () { |
||
| 32 | 54 | $result = null; |
|
|
|
|||
| 33 | |||
| 34 | 54 | if ($this->runNow) { |
|
| 35 | 12 | $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 | 54 | if ($this->artisanCommand->getOutput()->isVerbose()) { |
|
| 41 | $this->artisanCommand->getOutput()->newLine(); |
||
| 42 | $this->artisanCommand->info($result); |
||
| 43 | } |
||
| 44 | 54 | }); |
|
| 45 | } |
||
| 46 | } |
||
| 47 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.