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

nette / bootstrap / 3908326824

pending completion
3908326824

push

github

David Grudl
PhpExtension: simplification, uses only ini_set

3 of 3 new or added lines in 1 file covered. (100.0%)

120 of 133 relevant lines covered (90.23%)

0.9 hits per line

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

85.71
/src/Bootstrap/Extensions/PhpExtension.php
1
<?php
2

3
/**
4
 * This file is part of the Nette Framework (https://nette.org)
5
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6
 */
7

8
declare(strict_types=1);
9

10
namespace Nette\Bootstrap\Extensions;
11

12
use Nette;
13
use Nette\Schema\Expect;
14

15

16
/**
17
 * PHP directives definition.
18
 */
19
final class PhpExtension extends Nette\DI\CompilerExtension
20
{
21
        public function getConfigSchema(): Nette\Schema\Schema
22
        {
23
                return Expect::arrayOf(Expect::scalar()->dynamic());
1✔
24
        }
25

26

27
        public function loadConfiguration()
28
        {
29
                foreach ($this->getConfig() as $name => $value) {
1✔
30
                        if (!function_exists('ini_set')) {
1✔
31
                                throw new Nette\NotSupportedException('Required function ini_set() is disabled.');
×
32
                        }
33

34
                        if ($value !== null) {
1✔
35
                                $this->initialization->addBody('ini_set(?, (string) (?));', [$name, $value]);
1✔
36
                        }
37
                }
38
        }
1✔
39
}
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