| Conditions | 12 |
| Paths | 2048 |
| Total Lines | 81 |
| Code Lines | 57 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 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 namespace crocodicstudio\crudbooster\commands; |
||
| 95 | $this->info('------------------- :===: Completed !! :===: ------------------------'); |
||
| 96 | } else { |
||
| 97 | $this->info('------------------- :===: Failed !! :===: ------------------------'); |
||
| 98 | } |
||
| 99 | } |
||
| 100 | |||
| 101 | /** |
||
| 102 | * Get the composer command for the environment. |
||
| 103 | * |
||
| 104 | * @return string |
||
| 105 | */ |
||
| 106 | protected function findComposer() |
||
| 107 | { |
||
| 108 | if (file_exists(getcwd().'/composer.phar')) { |
||
| 109 | return '"'.PHP_BINARY.'" '.getcwd().'/composer.phar'; |
||
| 110 | } |
||
| 111 | |||
| 112 | return 'composer'; |
||
| 113 | } |
||
| 114 | |||
| 115 | private function symlinkForUpload() |
||
| 116 | { |
||
| 117 | $this->info('Checking public/uploads symlink...'); |
||
| 118 | if (!file_exists(public_path('uploads'))) { |
||
| 119 | $this->info('Creating public/uploads symlink...'); |
||
| 120 | app('files')->link(storage_path('app'), public_path('uploads')); |
||
| 121 | return; |
||
| 122 | } |
||
| 123 | $uploadPath = public_path('uploads'); |
||
| 124 | $this->info('Upload Path: '.$uploadPath); |
||
| 125 | if (realpath($uploadPath) == $uploadPath) { |
||
| 126 | $this->info('Remove the existing uploads dir, and create a symlink for it...'); |
||
| 127 | rrmdir(public_path('uploads')); |
||
| 128 | app('files')->link(storage_path('app'), public_path('uploads')); |
||
| 129 | } |
||
| 130 | } |
||
| 131 | |||
| 132 | private function symlinkForAsset() |
||
| 133 | { |
||
| 134 | $this->info('Checking public/vendor/crudbooster symlink...'); |
||
| 135 | |||
| 136 | |||
| 137 | $vendorPath = public_path('vendor'.DIRECTORY_SEPARATOR.'crudbooster'); |
||
| 138 | |||
| 139 | if (!file_exists($vendorPath)) { |
||
| 140 | $this->info('Creating public/vendor/crudbooster symlink...'); |
||
| 141 | app('files')->link(__DIR__.'/../assets', public_path('vendor/crudbooster')); |
||
| 142 | return ; |
||
| 143 | } |
||
| 144 | |||
| 145 | $this->info('Vendor Path: '.$vendorPath); |
||
| 146 | |||
| 147 | if (realpath($vendorPath) == $vendorPath) { |
||
| 148 | $this->info('Removing public/vendor/crudbooster dir, instead of creating a symlink...'); |
||
| 149 | rrmdir($vendorPath); |
||
| 150 | app('files')->link(__DIR__.'/../assets', $vendorPath); |
||
| 151 | } |
||
| 152 | } |
||
| 153 | |||
| 154 | private function removeDefaultMigrations() |
||
| 155 | { |
||
| 156 | $this->info('I remove some default migration files from laravel...'); |
||
| 157 | @unlink(base_path('database/migrations/2014_10_12_000000_create_users_table.php')); |
||
| 158 | @unlink(base_path('database/migrations/2014_10_12_100000_create_password_resets_table.php')); |
||
| 159 | |||
| 160 | } |
||
| 161 | |||
| 162 | private function installCrudbooster() |
||
| 163 | { |
||
| 164 | $this->info('Publishing CRUDBooster needs file...'); |
||
| 165 | $this->callSilent('vendor:publish', ['--provider' => 'crocodicstudio\\crudbooster\\CRUDBoosterServiceProvider', '--force' => true]); |
||
| 166 | $this->callSilent('vendor:publish', ['--tag' => 'cb_migration', '--force' => true]); |
||
| 167 | $this->callSilent('vendor:publish', ['--tag' => 'cb_lfm', '--force' => true]); |
||
| 168 | $this->callSilent('vendor:publish', ['--tag' => 'cb_localization', '--force' => true]); |
||
| 169 | |||
| 170 | $this->info('Dumping the autoloaded files and reloading all new files...'); |
||
| 171 | $composer = $this->findComposer(); |
||
| 172 | $process = new Process($composer.' dumpautoload'); |
||
| 173 | $process->setWorkingDirectory(base_path())->run(); |
||
| 174 | |||
| 175 | $this->info('Migrating database...'); |
||
| 176 | $this->call('migrate', ['--path'=> '\database\migrations\crudbooster']); |
||
| 202 |
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