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

nette / bootstrap / 5772376961

pending completion
5772376961

push

github

dg
PhpExtension: validates options

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

125 of 138 relevant lines covered (90.58%)

0.91 hits per line

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

88.89
/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(
1✔
24
                        Expect::type('scalar|null')->dynamic(),
1✔
25
                        Expect::string(),
1✔
26
                );
27
        }
28

29

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

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