| Conditions | 5 |
| Paths | 9 |
| Total Lines | 73 |
| Code Lines | 30 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 36 | protected function handleInternal() |
||
| 37 | { |
||
| 38 | $force = $this->input->getOption('force'); |
||
| 39 | |||
| 40 | /* |
||
| 41 | |-------------------------------------------------------------------------- |
||
| 42 | | Topics |
||
| 43 | |-------------------------------------------------------------------------- |
||
| 44 | | |
||
| 45 | */ |
||
| 46 | foreach ($this->carrot->container()->topics()->all() as $entity) { |
||
| 47 | if ($force) { |
||
| 48 | $entity->delete(); |
||
| 49 | |||
| 50 | $this->output->writeln( |
||
| 51 | vsprintf( |
||
| 52 | 'Deleted TOPIC <info>%s</info> - <fg=yellow>%s</>', |
||
| 53 | [ |
||
| 54 | $entity->id(), |
||
| 55 | $entity->name(), |
||
| 56 | ] |
||
| 57 | ) |
||
| 58 | ); |
||
| 59 | } |
||
| 60 | |||
| 61 | $entity->install(); |
||
| 62 | |||
| 63 | $this->output->writeln( |
||
| 64 | vsprintf( |
||
| 65 | 'Created <info>TOPIC</info> <fg=yellow>%s</> - <fg=yellow>%s</>', |
||
| 66 | [ |
||
| 67 | $entity->name(), |
||
| 68 | $entity->id(), |
||
| 69 | ] |
||
| 70 | ) |
||
| 71 | ); |
||
| 72 | }//end foreach |
||
| 73 | |||
| 74 | /* |
||
| 75 | |-------------------------------------------------------------------------- |
||
| 76 | | Queues |
||
| 77 | |-------------------------------------------------------------------------- |
||
| 78 | | |
||
| 79 | */ |
||
| 80 | foreach ($this->carrot->container()->queues()->all() as $entity) { |
||
| 81 | if ($force) { |
||
| 82 | $entity->delete(); |
||
| 83 | |||
| 84 | $this->output->writeln( |
||
| 85 | vsprintf( |
||
| 86 | 'Deleted QUEUE <info>%s</info> - <fg=yellow>%s</>', |
||
| 87 | [ |
||
| 88 | $entity->id(), |
||
| 89 | $entity->name(), |
||
| 90 | ] |
||
| 91 | ) |
||
| 92 | ); |
||
| 93 | } |
||
| 94 | |||
| 95 | $entity->install(); |
||
| 96 | |||
| 97 | $this->output->writeln( |
||
| 98 | vsprintf( |
||
| 99 | 'Created <info>QUEUE</info> <fg=yellow>%s</> - <fg=yellow>%s</>', |
||
| 100 | [ |
||
| 101 | $entity->name(), |
||
| 102 | $entity->id(), |
||
| 103 | ] |
||
| 104 | ) |
||
| 105 | ); |
||
| 106 | }//end foreach |
||
| 107 | |||
| 108 | return 0; |
||
| 109 | } |
||
| 112 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths