Conditions | 6 |
Paths | 10 |
Total Lines | 28 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 24 |
CRAP Score | 6 |
Changes | 5 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | 6 | public function fire() |
|
28 | { |
||
29 | 6 | $command = $this->option('command'); |
|
30 | |||
31 | 6 | ob_start(); |
|
32 | 6 | $result = $this->executeCode( |
|
|
|||
33 | 6 | trim(trim($command), ';').';' |
|
34 | 6 | ); |
|
35 | 6 | $output = ob_get_clean(); |
|
36 | |||
37 | 6 | if (empty($output) === false) { |
|
38 | 2 | $this->line($output); |
|
39 | 2 | } |
|
40 | |||
41 | 6 | $this->getOutput()->write('=> '); |
|
42 | 6 | switch (gettype($result)) { |
|
43 | 6 | case 'object': |
|
44 | 6 | case 'array': |
|
45 | 2 | $this->line(var_export($result, true)); |
|
46 | 2 | break; |
|
47 | 4 | case 'string': |
|
48 | 1 | $this->comment($result); |
|
49 | 1 | break; |
|
50 | 3 | default: |
|
51 | 3 | is_numeric($result) === true ? $this->info($result) : $this->line($result); |
|
52 | 3 | break; |
|
53 | 6 | } |
|
54 | 6 | } |
|
55 | |||
80 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.