Conditions | 3 |
Paths | 4 |
Total Lines | 51 |
Code Lines | 36 |
Lines | 0 |
Ratio | 0 % |
Changes | 10 | ||
Bugs | 5 | Features | 1 |
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 namespace crocodicstudio\crudbooster\commands; |
||
32 | public function handle() |
||
33 | { |
||
34 | |||
35 | $this->header(); |
||
36 | $this->checkRequirements(); |
||
37 | |||
38 | $this->info('Updating: '); |
||
39 | |||
40 | if (! file_exists(public_path('vendor'))) { |
||
41 | mkdir(public_path('vendor'), 0777); |
||
42 | } |
||
43 | |||
44 | $this->info('Publishing CRUDBooster needs file...'); |
||
45 | $this->call('vendor:publish'); |
||
46 | $this->call('vendor:publish', ['--tag' => 'cb_migration', '--force' => true]); |
||
47 | $this->call('vendor:publish', ['--tag' => 'cb_lfm', '--force' => true]); |
||
48 | $this->call('vendor:publish', ['--tag' => 'cb_localization', '--force' => true]); |
||
49 | |||
50 | $configLFM = config_path('lfm.php'); |
||
51 | $configLFM = file_get_contents($configLFM); |
||
52 | $configLFMModified = str_replace("['web','auth']", "['web','\crocodicstudio\crudbooster\middlewares\CBBackend']", $configLFM); |
||
53 | $configLFMModified = str_replace('Unisharp\Laravelfilemanager\Handlers\ConfigHandler::class', 'function() {return Session::get("admin_id");}', $configLFMModified); |
||
54 | $configLFMModified = str_replace('auth()->user()->id', 'Session::get("admin_id")', $configLFMModified); |
||
55 | $configLFMModified = str_replace("'alphanumeric_filename' => false", "'alphanumeric_filename' => true", $configLFMModified); |
||
56 | $configLFMModified = str_replace("'alphanumeric_directory' => false", "'alphanumeric_directory' => true", $configLFMModified); |
||
57 | $configLFMModified = str_replace("'alphanumeric_directory' => false", "'alphanumeric_directory' => true", $configLFMModified); |
||
58 | $configLFMModified = str_replace("'base_directory' => 'public'", "'base_directory' => 'storage/app'", $configLFMModified); |
||
59 | $configLFMModified = str_replace("'images_folder_name' => 'photos'", "'images_folder_name' => 'uploads'", $configLFMModified); |
||
60 | $configLFMModified = str_replace("'files_folder_name' => 'files'", "'files_folder_name' => 'uploads'", $configLFMModified); |
||
61 | file_put_contents(config_path('lfm.php'), $configLFMModified); |
||
62 | |||
63 | $this->info('Dumping the autoloaded files and reloading all new files...'); |
||
64 | $composer = $this->findComposer(); |
||
65 | $process = new Process($composer.' dumpautoload'); |
||
66 | $process->setWorkingDirectory(base_path())->run(); |
||
67 | |||
68 | $this->info('Migrating database...'); |
||
69 | $this->call('migrate'); |
||
70 | |||
71 | if (! class_exists('CBSeeder')) { |
||
72 | require_once __DIR__.'/../database/seeds/CBSeeder.php'; |
||
73 | } |
||
74 | $this->call('db:seed', ['--class' => 'CBSeeder']); |
||
75 | |||
76 | $this->info('Clearing Cache...'); |
||
77 | Cache::flush(); |
||
78 | |||
79 | $this->info('Clearing config cache...'); |
||
80 | $this->call('config:clear'); |
||
81 | |||
82 | $this->footer(); |
||
83 | } |
||
211 |
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