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

codeigniter4 / settings / 13399286100

18 Feb 2025 08:14PM UTC coverage: 85.526%. Remained the same
13399286100

push

github

web-flow
chore: update dependencies to support PHP 8.1 - 8.4 (#145)

* move to PHP 8.1 and PHPUnit 10

* update tests

* cs fix

* update workflows

* update php version in the docs

* update rector config

* update psalm config

1 of 2 new or added lines in 2 files covered. (50.0%)

195 of 228 relevant lines covered (85.53%)

55.95 hits per line

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

100.0
/src/Helpers/setting_helper.php
1
<?php
2

3
use CodeIgniter\Settings\Settings;
4

5
if (! function_exists('setting')) {
6✔
6
    /**
7
     * Provides a convenience interface to the Settings service.
8
     *
9
     * @param mixed $value
10
     *
11
     * @return         array|bool|float|int|object|Settings|string|void|null
12
     * @phpstan-return ($key is null ? Settings : ($value is null ? array|bool|float|int|object|string|null : void))
13
     */
14
    function setting(?string $key = null, $value = null)
15
    {
16
        /** @var Settings $setting */
17
        $setting = service('settings');
30✔
18

19
        if (empty($key)) {
30✔
20
            return $setting;
6✔
21
        }
22

23
        // Getting the value?
24
        if (count(func_get_args()) === 1) {
24✔
25
            return $setting->get($key);
24✔
26
        }
27

28
        // Setting the value
29
        $setting->set($key, $value);
12✔
30
    }
31
}
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