Skip to content

Commit bb14248

Browse files
Merge remote-tracking branch 'origin/1.x' into 1.x
2 parents 0fafc8f + d9104e9 commit bb14248

24 files changed

+42
-50
lines changed

config/preload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
'condition' => [
3232
'store' => null,
3333
'hits' => 10000,
34-
'key' => 'preload|request_count'
34+
'key' => 'preload|request_count',
3535
],
3636

3737
/*

src/Compiler/Pipes/FireEvent.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
use Closure;
66
use Illuminate\Contracts\Events\Dispatcher;
7-
use Illuminate\Filesystem\Filesystem;
8-
use Illuminate\Support\Collection;
97
use Laragear\Preload\Events\PreloadGenerated;
10-
use Laragear\Preload\Exceptions\PreloadException;
118
use Laragear\Preload\Listing;
129

1310
class FireEvent

src/Compiler/Pipes/LoadPreloadStub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function stubContents(): string
4646
try {
4747
return $this->files->get(Preloader::STUB);
4848
} catch (FileNotFoundException $e) {
49-
throw new PreloadException('Cannot read the stub "' . Preloader::STUB . '" contents.', $e->getCode(), $e);
49+
throw new PreloadException('Cannot read the stub "'.Preloader::STUB.'" contents.', $e->getCode(), $e);
5050
}
5151
}
5252
}

src/Compiler/Pipes/UpdateListingConfig.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Closure;
66
use Illuminate\Contracts\Config\Repository as ConfigContract;
7-
use Illuminate\Support\Facades\Config;
87
use Laragear\Preload\Listing;
98

109
class UpdateListingConfig
@@ -53,7 +52,7 @@ protected function listConfig(Listing $listing): array
5352
$listing->memory ? $listing->memory.' MB' : '(disabled)',
5453
$listing->appendCount,
5554
$listing->excludeCount,
56-
]
55+
],
5756
];
5857
}
5958
}

src/Compiler/Pipes/UpdateListingFiles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class UpdateListingFiles
1818
public function handle(Listing $listing, Closure $next): Listing
1919
{
2020
$listing->output = $listing->output->replace('@list',
21-
PHP_EOL .
22-
' ' . "'" . $listing->files->implode("'," . PHP_EOL . " '") . "'" .
21+
PHP_EOL.
22+
' '."'".$listing->files->implode("',".PHP_EOL." '")."'".
2323
PHP_EOL
2424
);
2525

src/Compiler/Pipes/UpdateListingStatistics.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ protected function statistics(Listing $listing): array
6060
$listing->path,
6161
now()->toDateTimeString(),
6262
$this->config->get('preload.use_require')
63-
? 'require_once \'' . realpath($this->config->get('preload.autoloader')).'\';'
63+
? 'require_once \''.realpath($this->config->get('preload.autoloader')).'\';'
6464
: null,
6565
$this->config->get('preload.ignore_not_found') ? 'continue;' : 'throw new \Exception("{$file} does not exist or is unreadable.");',
6666
$this->config->get('preload.use_require') ? 'require_once $file' : 'opcache_compile_file($file)',
67-
]
67+
],
6868
];
6969
}
7070

src/Compiler/Pipes/UpdateOpcacheConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function opcacheConfig(array $opcache): array
4646
$opcache['opcache_statistics']['num_cached_scripts'],
4747
number_format($opcache['opcache_statistics']['opcache_hit_rate'], 2, '.', ''),
4848
$opcache['opcache_statistics']['misses'],
49-
]
49+
],
5050
];
5151
}
5252
}

src/Console/Commands/Placeholder.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Illuminate\Filesystem\Filesystem;
88
use JetBrains\PhpStorm\Pure;
99
use Laragear\Preload\Preloader;
10-
use function php_ini_loaded_file;
1110

1211
class Placeholder extends Command
1312
{
@@ -43,15 +42,17 @@ public function handle(Filesystem $file, ConfigContract $config): void
4342
{
4443
$path = $config->get('preload.path');
4544

46-
$this->comment('Generating a preload placeholder at: ' . $path);
45+
$this->comment('Generating a preload placeholder at: '.$path);
4746
$this->newLine();
4847

4948
if ($file->exists($path)) {
5049
if ($this->isPlaceholder($file, $path)) {
5150
$this->info('A placeholder preload script already exists, no need to generate it again.');
51+
5252
return;
5353
} elseif ($this->deniesOverwrite()) {
5454
$this->warn('A preload script already exists, skipping.');
55+
5556
return;
5657
}
5758
}

src/Facades/Preload.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* @method static \Laragear\Preload\Listing list()
1414
* @method static \Laragear\Preload\Listing generate(\Laragear\Preload\Listing $listing = null)
1515
* @method static \Illuminate\Support\Collection getFilesFromFinder(\Closure $callback)
16-
*
1716
* @method static \Laragear\Preload\Preloader getFacadeRoot()
1817
*
1918
* @see \Laragear\Preload\Preloader

src/Http/Middleware/PreloadMiddleware.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
use Laragear\Preload\Condition;
99
use Laragear\Preload\Facades\Preload;
1010
use Laragear\Preload\Jobs\StorePreloadScript;
11-
use Symfony\Component\HttpFoundation\Response;
1211
use function resolve;
12+
use Symfony\Component\HttpFoundation\Response;
1313

1414
class PreloadMiddleware
1515
{
@@ -18,7 +18,6 @@ class PreloadMiddleware
1818
*
1919
* @param \Illuminate\Http\Request $request
2020
* @param \Closure $next
21-
*
2221
* @return mixed
2322
*/
2423
public function handle(Request $request, Closure $next): mixed
@@ -31,14 +30,13 @@ public function handle(Request $request, Closure $next): mixed
3130
*
3231
* @param \Illuminate\Http\Request $request
3332
* @param \Symfony\Component\HttpFoundation\Response $response
34-
*
3533
* @return void
3634
*/
3735
public function terminate(Request $request, Response $response)
3836
{
3937
if ($response->isSuccessful() && $this->conditionIsTrue($request, $response)) {
4038
$config = Config::get([
41-
'preload.job.connection', 'preload.job.queue'
39+
'preload.job.connection', 'preload.job.queue',
4240
]);
4341

4442
StorePreloadScript::dispatch(Preload::list())

0 commit comments

Comments
 (0)