From abc683f9cfc0449e0037371822893b3949e8e8df Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 26 Sep 2023 02:31:57 +0200 Subject: [PATCH] cs --- src/RobotLoader/RobotLoader.php | 4 ++-- tests/Loaders/RobotLoader.phar.phpt | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/RobotLoader/RobotLoader.php b/src/RobotLoader/RobotLoader.php index 2bbbe06..9fa4257 100644 --- a/src/RobotLoader/RobotLoader.php +++ b/src/RobotLoader/RobotLoader.php @@ -78,7 +78,7 @@ public function __destruct() */ public function register(bool $prepend = false): static { - spl_autoload_register([$this, 'tryLoad'], true, $prepend); + spl_autoload_register([$this, 'tryLoad'], prepend: $prepend); return $this; } @@ -475,7 +475,7 @@ private function saveCache($lock = null): void } if (function_exists('opcache_invalidate')) { - @opcache_invalidate($file, true); // @ can be restricted + @opcache_invalidate($file, force: true); // @ can be restricted } } diff --git a/tests/Loaders/RobotLoader.phar.phpt b/tests/Loaders/RobotLoader.phar.phpt index 4d5b18e..804a46d 100644 --- a/tests/Loaders/RobotLoader.phar.phpt +++ b/tests/Loaders/RobotLoader.phar.phpt @@ -45,14 +45,18 @@ Assert::true(class_exists('D')); $loader = new RobotLoader; $loader->setTempDirectory(getTempDir()); $loader->addDirectory("phar://$pharFile/non-dir"); -Assert::exception(function () use ($loader) { - $loader->rebuild(); -}, Nette\IOException::class, "File or directory 'phar://$pharFile/non-dir' not found."); +Assert::exception( + fn() => $loader->rebuild(), + Nette\IOException::class, + "File or directory 'phar://$pharFile/non-dir' not found.", +); $loader = new RobotLoader; $loader->setTempDirectory(getTempDir()); $loader->addDirectory("phar://$pharFile/non-file.php"); -Assert::exception(function () use ($loader) { - $loader->rebuild(); -}, Nette\IOException::class, "File or directory 'phar://$pharFile/non-file.php' not found."); +Assert::exception( + fn() => $loader->rebuild(), + Nette\IOException::class, + "File or directory 'phar://$pharFile/non-file.php' not found.", +);