Conditions | 7 |
Paths | 36 |
Total Lines | 66 |
Code Lines | 45 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | 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 | |||
37 | $this->checkRequirements(); |
||
38 | |||
39 | $this->info('Installing: '); |
||
40 | /* Removing the default user and password reset, it makes you ambigous when using CRUDBooster */ |
||
41 | $this->info('I remove some default migration files from laravel...'); |
||
42 | if (file_exists(base_path('database/migrations/2014_10_12_000000_create_users_table.php'))) { |
||
43 | @unlink(base_path('database/migrations/2014_10_12_000000_create_users_table.php')); |
||
44 | } |
||
45 | if (file_exists(base_path('database/migrations/2014_10_12_100000_create_password_resets_table.php'))) { |
||
46 | @unlink(base_path('database/migrations/2014_10_12_100000_create_password_resets_table.php')); |
||
47 | } |
||
48 | |||
49 | if ($this->confirm('Do you have setting the database configuration at .env ?')) { |
||
50 | |||
51 | if (! file_exists(public_path('vendor'))) { |
||
52 | mkdir(public_path('vendor'), 0777); |
||
53 | } |
||
54 | |||
55 | $this->info('Publishing CRUDBooster needs file...'); |
||
56 | $this->call('vendor:publish', ['--provider' => 'crocodicstudio\crudbooster\CRUDBoosterServiceProvider']); |
||
57 | $this->call('vendor:publish', ['--provider' => 'Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider']); |
||
58 | $this->call('vendor:publish', ['--tag' => 'cb_migration', '--force' => true]); |
||
59 | $this->call('vendor:publish', ['--tag' => 'cb_localization', '--force' => true]); |
||
60 | |||
61 | $configLFM = config_path('lfm.php'); |
||
62 | $configLFM = file_get_contents($configLFM); |
||
63 | $configLFMModified = str_replace("['web','auth']", "['web','\crocodicstudio\crudbooster\middlewares\CBBackend']", $configLFM); |
||
64 | $configLFMModified = str_replace('Unisharp\Laravelfilemanager\Handlers\ConfigHandler::class', 'function() {return Session::get("admin_id");}', $configLFMModified); |
||
65 | $configLFMModified = str_replace('auth()->user()->id', 'Session::get("admin_id")', $configLFMModified); |
||
66 | $configLFMModified = str_replace("'alphanumeric_filename' => false", "'alphanumeric_filename' => true", $configLFMModified); |
||
67 | $configLFMModified = str_replace("'alphanumeric_directory' => false", "'alphanumeric_directory' => true", $configLFMModified); |
||
68 | $configLFMModified = str_replace("'alphanumeric_directory' => false", "'alphanumeric_directory' => true", $configLFMModified); |
||
69 | $configLFMModified = str_replace("'base_directory' => 'public'", "'base_directory' => 'storage/app'", $configLFMModified); |
||
70 | $configLFMModified = str_replace("'images_folder_name' => 'photos'", "'images_folder_name' => 'uploads'", $configLFMModified); |
||
71 | $configLFMModified = str_replace("'files_folder_name' => 'files'", "'files_folder_name' => 'uploads'", $configLFMModified); |
||
72 | file_put_contents(config_path('lfm.php'), $configLFMModified); |
||
73 | |||
74 | $this->info('Dumping the autoloaded files and reloading all new files...'); |
||
75 | $composer = $this->findComposer(); |
||
76 | $process = new Process($composer.' dumpautoload'); |
||
77 | $process->setWorkingDirectory(base_path())->run(); |
||
78 | |||
79 | $this->info('Migrating database...'); |
||
80 | $this->call('migrate'); |
||
81 | |||
82 | if (! class_exists('CBSeeder')) { |
||
83 | require_once __DIR__.'/../database/seeds/CBSeeder.php'; |
||
84 | } |
||
85 | $this->call('db:seed', ['--class' => 'CBSeeder']); |
||
86 | $this->call('config:clear'); |
||
87 | if (app()->version() < 5.6) { |
||
88 | $this->call('optimize'); |
||
89 | } |
||
90 | |||
91 | $this->info('Installing CRUDBooster Is Completed ! Thank You :)'); |
||
92 | } else { |
||
93 | $this->info('Setup Aborted !'); |
||
94 | $this->info('Please setting the database configuration for first !'); |
||
95 | } |
||
96 | |||
97 | $this->footer(); |
||
98 | } |
||
226 |
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