| Code Coverage
| Lines | Functions and Methods | Classes and Traits
Total | 100.00% covered (success) | 100.00% | 3 / 3 | 100.00% covered (success) | 100.00% | 1 / 1 | CRAP | 100.00% covered (success) | 100.00% | 1 / 1
Settings | 100.00% covered (success) | 100.00% | 3 / 3 | 100.00% covered (success) | 100.00% | 1 / 1 | 4 | 100.00% covered (success) | 100.00% | 1 / 1
__construct | 100.00% covered (success) | 100.00% | 3 / 3 | 100.00% covered (success) | 100.00% | 1 / 1 | 4 |

1 | <?php
2 |
3 | namespace Config;
4 |
5 | use CodeIgniter\Settings\Config\Settings as BaseSettings;
6 |
7 | class Settings extends BaseSettings
8 | {
9 | public $database = [
10 | 'class' => \CodeIgniter\Settings\Handlers\DatabaseHandler::class,
11 | 'table' => 'settings',
12 | 'group' => null,
13 | 'writeable' => true,
14 | 'deferWrites' => false,
15 | ];
16 |
17 | public function __construct()
18 | {
19 | parent::__construct();
20 |
21 | $forcedGroup = getenv('SETTINGS_DB_GROUP') ?: null;
22 | $this->database['group'] = $forcedGroup ?: (ENVIRONMENT === 'testing' ? 'tests' : null);
23 | }
24 | }