From 91601a01e8a67c58c94bf49da189b762e9319f2f Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Mon, 13 Mar 2023 18:05:18 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Compiler/Pipes/UpdateListingFiles.php | 1 + src/Compiler/Pipes/UpdateListingStatistics.php | 1 + src/Compiler/Pipes/UpdateOpcacheConfig.php | 1 + src/Http/Middleware/PreloadMiddleware.php | 3 ++- src/Lister/Pipes/CutListByMemoryLimit.php | 1 + src/Lister/Pipes/MayAppendExternalFiles.php | 1 + src/Opcache.php | 3 ++- src/Preloader.php | 9 +++++---- tests/Compiler/CompilerTest.php | 2 +- 9 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Compiler/Pipes/UpdateListingFiles.php b/src/Compiler/Pipes/UpdateListingFiles.php index 7bf43cc..04cf25d 100644 --- a/src/Compiler/Pipes/UpdateListingFiles.php +++ b/src/Compiler/Pipes/UpdateListingFiles.php @@ -4,6 +4,7 @@ use Closure; use Laragear\Preload\Listing; + use const PHP_EOL; class UpdateListingFiles diff --git a/src/Compiler/Pipes/UpdateListingStatistics.php b/src/Compiler/Pipes/UpdateListingStatistics.php index 1369b65..d626af0 100644 --- a/src/Compiler/Pipes/UpdateListingStatistics.php +++ b/src/Compiler/Pipes/UpdateListingStatistics.php @@ -7,6 +7,7 @@ use Illuminate\Support\Facades\File; use Laragear\Preload\Exceptions\PreloadException; use Laragear\Preload\Listing; + use function now; use function realpath; diff --git a/src/Compiler/Pipes/UpdateOpcacheConfig.php b/src/Compiler/Pipes/UpdateOpcacheConfig.php index 1e0986f..e8420d7 100644 --- a/src/Compiler/Pipes/UpdateOpcacheConfig.php +++ b/src/Compiler/Pipes/UpdateOpcacheConfig.php @@ -4,6 +4,7 @@ use Closure; use Laragear\Preload\Listing; + use function number_format; class UpdateOpcacheConfig diff --git a/src/Http/Middleware/PreloadMiddleware.php b/src/Http/Middleware/PreloadMiddleware.php index 428004a..ad67df3 100644 --- a/src/Http/Middleware/PreloadMiddleware.php +++ b/src/Http/Middleware/PreloadMiddleware.php @@ -8,9 +8,10 @@ use Laragear\Preload\Condition; use Laragear\Preload\Facades\Preload; use Laragear\Preload\Jobs\StorePreloadScript; -use function resolve; use Symfony\Component\HttpFoundation\Response; +use function resolve; + class PreloadMiddleware { /** diff --git a/src/Lister/Pipes/CutListByMemoryLimit.php b/src/Lister/Pipes/CutListByMemoryLimit.php index 8030cea..f235063 100644 --- a/src/Lister/Pipes/CutListByMemoryLimit.php +++ b/src/Lister/Pipes/CutListByMemoryLimit.php @@ -4,6 +4,7 @@ use Closure; use Laragear\Preload\Listing; + use function round; class CutListByMemoryLimit diff --git a/src/Lister/Pipes/MayAppendExternalFiles.php b/src/Lister/Pipes/MayAppendExternalFiles.php index 4f99a43..244adba 100644 --- a/src/Lister/Pipes/MayAppendExternalFiles.php +++ b/src/Lister/Pipes/MayAppendExternalFiles.php @@ -5,6 +5,7 @@ use Closure; use Laragear\Preload\Listing; use Laragear\Preload\Preloader; + use function max; class MayAppendExternalFiles diff --git a/src/Opcache.php b/src/Opcache.php index ec3bf48..3dbf45d 100644 --- a/src/Opcache.php +++ b/src/Opcache.php @@ -2,9 +2,10 @@ namespace Laragear\Preload; -use function function_exists; use RuntimeException; +use function function_exists; + /** * Class Opcache. * diff --git a/src/Preloader.php b/src/Preloader.php index 9a2d6be..b339ece 100644 --- a/src/Preloader.php +++ b/src/Preloader.php @@ -5,11 +5,12 @@ use Closure; use Illuminate\Contracts\Config\Repository as ConfigContract; use Illuminate\Support\Collection; -use function is_string; -use function resolve; use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\SplFileInfo; +use function is_string; +use function resolve; + class Preloader { /** @@ -53,7 +54,7 @@ public function __construct( * @param \Closure|string ...$exclude * @return void */ - public function exclude(Closure|string ...$exclude): void + public function exclude(Closure | string ...$exclude): void { $this->exclude = $this->normalizeListing($exclude); } @@ -64,7 +65,7 @@ public function exclude(Closure|string ...$exclude): void * @param \Closure|string ...$append * @return void */ - public function append(Closure|string ...$append): void + public function append(Closure | string ...$append): void { $this->append = $this->normalizeListing($append); } diff --git a/tests/Compiler/CompilerTest.php b/tests/Compiler/CompilerTest.php index 6f2fc5b..bfcea5f 100644 --- a/tests/Compiler/CompilerTest.php +++ b/tests/Compiler/CompilerTest.php @@ -115,7 +115,7 @@ public function test_generates_script_in_path(): void SCRIPT - , $script); + , $script); return true; })