| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function run() |
||
| 18 | { |
||
| 19 | $module = $this->controller->module; |
||
| 20 | |||
| 21 | $clients = $module->getClientRepository()->getAllClients(); |
||
| 22 | |||
| 23 | if (!$clients) { |
||
|
|
|||
| 24 | $this->controller->stdout('No clients defined. Run `yii ' |
||
| 25 | . $this->controller->uniqueId . '/create` to define one.' . PHP_EOL); |
||
| 26 | return ExitCode::OK; |
||
| 27 | } |
||
| 28 | |||
| 29 | $this->controller->stdout($this->generateClientsTable($clients)); |
||
| 30 | |||
| 31 | return ExitCode::OK; |
||
| 32 | } |
||
| 34 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.