| Conditions | 8 |
| Paths | 21 |
| Total Lines | 38 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 64 | public function handle() |
||
| 65 | { |
||
| 66 | if (Settings::get('settings.migrated')) { |
||
| 67 | $this->info(trans('commands.migrate-settings.migrated')); |
||
|
1 ignored issue
–
show
|
|||
| 68 | if (!$this->option('force')) { |
||
| 69 | return; |
||
| 70 | } |
||
| 71 | $this->warn(trans('commands.migrate-settings.migrated_warning')); |
||
|
1 ignored issue
–
show
|
|||
| 72 | } |
||
| 73 | |||
| 74 | $settings = DbConfig::pluck('config_name'); |
||
| 75 | |||
| 76 | foreach ($settings as $key) { |
||
| 77 | $config_key = '_config.'.$key; |
||
| 78 | |||
| 79 | if (Config::has($config_key)) { |
||
| 80 | $old = Settings::get($key); |
||
| 81 | $new = Config::get($config_key); |
||
| 82 | |||
| 83 | if ($old !== $new) { |
||
| 84 | $this->info(trans('commands.migrate-settings.migrating', ['setting' => $key, 'old' => $old, 'new' => $new])); |
||
|
1 ignored issue
–
show
|
|||
| 85 | |||
| 86 | if (!$this->option('dry-run')) { |
||
| 87 | // we aren't authenticated so we can't write through the Settings facade |
||
| 88 | DbConfig::updateOrCreate(['config_name' => $key], ['config_value' => $new]); |
||
| 89 | } |
||
| 90 | } |
||
| 91 | } |
||
| 92 | } |
||
| 93 | |||
| 94 | if ($this->option('dry-run')) { |
||
| 95 | $this->warn(trans('commands.migrate-settings.nochanges')); |
||
|
1 ignored issue
–
show
|
|||
| 96 | } |
||
| 97 | else { |
||
| 98 | Settings::flush(); // clear the settings cache |
||
| 99 | DbConfig::updateOrCreate(['config_name' => 'settings.migrated'], ['config_value' => true]); |
||
| 100 | } |
||
| 101 | } |
||
| 102 | } |
||
| 103 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.