• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

codeigniter4 / settings / 8215383276

09 Mar 2024 03:05PM UTC coverage: 85.526%. Remained the same
8215383276

push

github

web-flow
Merge pull request #123 from codeigniter4/command-fix

0 of 1 new or added line in 1 file covered. (0.0%)

195 of 228 relevant lines covered (85.53%)

18.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Commands/ClearSettings.php
1
<?php
2

3
namespace CodeIgniter\Settings\Commands;
4

5
use CodeIgniter\CLI\BaseCommand;
6
use CodeIgniter\CLI\CLI;
7

8
class ClearSettings extends BaseCommand
9
{
10
    protected $group       = 'Housekeeping';
11
    protected $name        = 'settings:clear';
12
    protected $description = 'Clears all settings from the database.';
13

14
    public function run(array $params)
15
    {
16
        if (CLI::prompt('This will delete all settings from the database. Are you sure you want to continue?', ['y', 'n'], 'required') !== 'y') {
×
17
            return;
×
18
        }
19

NEW
20
        service('settings')->flush();
×
21

22
        CLI::write('Settings cleared from the database.', 'green');
×
23
    }
24
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc