Skip to content

Commit 3dc03fc

Browse files
committed
cs
1 parent eeb1c9d commit 3dc03fc

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

src/Bootstrap/Configurator.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,6 @@ protected function getCacheDirectory(): string
329329
}
330330

331331

332-
/********************* tools ****************d*g**/
333-
334-
335332
/**
336333
* Detects debug mode by IP addresses or computer names whitelist detection.
337334
*/
@@ -347,10 +344,9 @@ public static function detectDebugMode(string|array $list = null): bool
347344
if (!isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !isset($_SERVER['HTTP_FORWARDED'])) {
348345
$list[] = '127.0.0.1';
349346
$list[] = '::1';
350-
$list[] = '[::1]'; // workaround for PHP < 7.3.4
351347
}
352348

353-
return in_array($addr, $list, true) || in_array("$secret@$addr", $list, true);
349+
return in_array($addr, $list, strict: true) || in_array("$secret@$addr", $list, strict: true);
354350
}
355351
}
356352

src/Bootstrap/Extensions/ConstantsExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function getConfigSchema(): Nette\Schema\Schema
2727
}
2828

2929

30-
public function loadConfiguration()
30+
public function loadConfiguration(): void
3131
{
3232
foreach ($this->getConfig() as $name => $value) {
3333
$this->initialization->addBody('define(?, ?);', [$name, $value]);

src/Bootstrap/Extensions/PhpExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function getConfigSchema(): Nette\Schema\Schema
2727
}
2828

2929

30-
public function loadConfiguration()
30+
public function loadConfiguration(): void
3131
{
3232
foreach ($this->getConfig() as $name => $value) {
3333
if (!function_exists('ini_set')) {

tests/Bootstrap/Configurator.autowireExcluded.phpt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ $container = $configurator->createContainer();
3030

3131
Assert::type(Foo::class, $container->getByType('Foo'));
3232

33-
Assert::exception(function () use ($container) {
34-
$container->getByType('stdClass');
35-
}, Nette\DI\MissingServiceException::class);
33+
Assert::exception(
34+
fn() => $container->getByType('stdClass'),
35+
Nette\DI\MissingServiceException::class,
36+
);

tests/Bootstrap/Configurator.loadConfig.errors.phpt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ require __DIR__ . '/../bootstrap.php';
1515

1616
$configurator = new Configurator;
1717

18-
Assert::exception(function () use ($configurator) {
19-
$configurator->addConfig('files/missing.neon')
20-
->createContainer();
21-
}, Nette\InvalidStateException::class, 'Set path to temporary directory using setTempDirectory().');
18+
Assert::exception(
19+
fn() => $configurator->addConfig('files/missing.neon')->createContainer(),
20+
Nette\InvalidStateException::class,
21+
'Set path to temporary directory using setTempDirectory().',
22+
);

tests/Bootstrap/Configurator.robotLoader.phpt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ require __DIR__ . '/../bootstrap.php';
1515

1616
$configurator = new Configurator;
1717

18-
Assert::exception(function () use ($configurator) {
19-
$configurator->createRobotLoader();
20-
}, Nette\InvalidStateException::class, 'Set path to temporary directory using setTempDirectory().');
18+
Assert::exception(
19+
fn() => $configurator->createRobotLoader(),
20+
Nette\InvalidStateException::class,
21+
'Set path to temporary directory using setTempDirectory().',
22+
);
2123

2224

2325
$configurator->setTempDirectory(getTempDir());

0 commit comments

Comments
 (0)