| Conditions | 5 |
| Paths | 10 |
| Total Lines | 75 |
| Code Lines | 47 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| 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 |
||
| 64 | public function handle() |
||
| 65 | { |
||
| 66 | if (! in_array($this->argument('type'), [ |
||
| 67 | CommandData::$COMMAND_TYPE_API, |
||
| 68 | CommandData::$COMMAND_TYPE_SCAFFOLD, |
||
| 69 | CommandData::$COMMAND_TYPE_API_SCAFFOLD, |
||
| 70 | CommandData::$COMMAND_TYPE_GRAPHQL, |
||
| 71 | ])) { |
||
| 72 | $this->error('invalid rollback type'); |
||
| 73 | } |
||
| 74 | |||
| 75 | $this->commandData = new CommandData($this, $this->argument('type')); |
||
| 76 | $this->commandData->config->mName = $this->commandData->modelName = $this->argument('model'); |
||
| 77 | |||
| 78 | $this->commandData->config->init($this->commandData, ['tableName', 'prefix', 'plural', 'views']); |
||
| 79 | |||
| 80 | $views = $this->commandData->getOption('views'); |
||
| 81 | if (! empty($views)) { |
||
| 82 | $views = explode(',', $views); |
||
| 83 | $viewGenerator = new ViewGenerator($this->commandData); |
||
| 84 | $viewGenerator->rollback($views); |
||
| 85 | |||
| 86 | $this->info('Generating autoload files'); |
||
| 87 | $this->composer->dumpOptimized(); |
||
| 88 | |||
| 89 | return; |
||
| 90 | } |
||
| 91 | |||
| 92 | $migrationGenerator = new MigrationGenerator($this->commandData); |
||
| 93 | $migrationGenerator->rollback(); |
||
| 94 | |||
| 95 | $modelGenerator = new ModelGenerator($this->commandData); |
||
| 96 | $modelGenerator->rollback(); |
||
| 97 | |||
| 98 | $repositoryGenerator = new RepositoryGenerator($this->commandData); |
||
| 99 | $repositoryGenerator->rollback(); |
||
| 100 | |||
| 101 | $requestGenerator = new APIRequestGenerator($this->commandData); |
||
| 102 | $requestGenerator->rollback(); |
||
| 103 | |||
| 104 | $controllerGenerator = new APIControllerGenerator($this->commandData); |
||
| 105 | $controllerGenerator->rollback(); |
||
| 106 | |||
| 107 | $routesGenerator = new APIRoutesGenerator($this->commandData); |
||
| 108 | $routesGenerator->rollback(); |
||
| 109 | |||
| 110 | $requestGenerator = new RequestGenerator($this->commandData); |
||
| 111 | $requestGenerator->rollback(); |
||
| 112 | |||
| 113 | $controllerGenerator = new ControllerGenerator($this->commandData); |
||
| 114 | $controllerGenerator->rollback(); |
||
| 115 | |||
| 116 | $viewGenerator = new ViewGenerator($this->commandData); |
||
| 117 | $viewGenerator->rollback(); |
||
| 118 | |||
| 119 | $routeGenerator = new RoutesGenerator($this->commandData); |
||
| 120 | $routeGenerator->rollback(); |
||
| 121 | |||
| 122 | if ($this->commandData->getAddOn('tests')) { |
||
| 123 | $repositoryTestGenerator = new RepositoryTestGenerator($this->commandData); |
||
| 124 | $repositoryTestGenerator->rollback(); |
||
| 125 | |||
| 126 | $apiTestGenerator = new APITestGenerator($this->commandData); |
||
| 127 | $apiTestGenerator->rollback(); |
||
| 128 | } |
||
| 129 | |||
| 130 | if ($this->commandData->config->getAddOn('menu.enabled')) { |
||
| 131 | $menuGenerator = new MenuGenerator($this->commandData); |
||
| 132 | $menuGenerator->rollback(); |
||
| 133 | } |
||
| 134 | |||
| 135 | // TODO: Add rollback for the graphql files too. |
||
| 136 | |||
| 137 | $this->info('Generating autoload files'); |
||
| 138 | $this->composer->dumpOptimized(); |
||
| 139 | } |
||
| 169 |
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