Skip to content

Commit abc683f

Browse files
committed
cs
1 parent 7d88ff3 commit abc683f

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/RobotLoader/RobotLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function __destruct()
7878
*/
7979
public function register(bool $prepend = false): static
8080
{
81-
spl_autoload_register([$this, 'tryLoad'], true, $prepend);
81+
spl_autoload_register([$this, 'tryLoad'], prepend: $prepend);
8282
return $this;
8383
}
8484

@@ -475,7 +475,7 @@ private function saveCache($lock = null): void
475475
}
476476

477477
if (function_exists('opcache_invalidate')) {
478-
@opcache_invalidate($file, true); // @ can be restricted
478+
@opcache_invalidate($file, force: true); // @ can be restricted
479479
}
480480
}
481481

tests/Loaders/RobotLoader.phar.phpt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,18 @@ Assert::true(class_exists('D'));
4545
$loader = new RobotLoader;
4646
$loader->setTempDirectory(getTempDir());
4747
$loader->addDirectory("phar://$pharFile/non-dir");
48-
Assert::exception(function () use ($loader) {
49-
$loader->rebuild();
50-
}, Nette\IOException::class, "File or directory 'phar://$pharFile/non-dir' not found.");
48+
Assert::exception(
49+
fn() => $loader->rebuild(),
50+
Nette\IOException::class,
51+
"File or directory 'phar://$pharFile/non-dir' not found.",
52+
);
5153

5254

5355
$loader = new RobotLoader;
5456
$loader->setTempDirectory(getTempDir());
5557
$loader->addDirectory("phar://$pharFile/non-file.php");
56-
Assert::exception(function () use ($loader) {
57-
$loader->rebuild();
58-
}, Nette\IOException::class, "File or directory 'phar://$pharFile/non-file.php' not found.");
58+
Assert::exception(
59+
fn() => $loader->rebuild(),
60+
Nette\IOException::class,
61+
"File or directory 'phar://$pharFile/non-file.php' not found.",
62+
);

0 commit comments

Comments
 (0)