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

codeigniter4 / settings / 17488284278

05 Sep 2025 08:41AM UTC coverage: 85.088% (-0.4%) from 85.526%
17488284278

push

github

web-flow
update workflow for PHPUnit (#151)

194 of 228 relevant lines covered (85.09%)

18.6 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')) {
2✔
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');
10✔
18

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

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

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

© 2025 Coveralls, Inc