Skip to content

Commit 82d99c2

Browse files
committed
Laravel 10 support
1 parent 75a000b commit 82d99c2

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
}
1515
],
1616
"require": {
17-
"php": "^8.0",
17+
"php": "^8.1",
1818
"ext-pdo": "*",
19-
"illuminate/contracts": "^9.0",
20-
"illuminate/support": "^9.0",
21-
"illuminate/database": "^9.0",
19+
"illuminate/contracts": "^10.0",
20+
"illuminate/support": "^10.0",
21+
"illuminate/database": "^10.0",
2222
"psr/log": "^1|^2|^3"
2323
},
2424
"autoload": {

src/QueryLogger/QueryLogger.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,12 @@
1919
use Illuminate\Support\Arr;
2020
use Psr\Log\LoggerInterface;
2121

22-
class QueryLogger
22+
final class QueryLogger
2323
{
24-
protected LoggerInterface $logger;
25-
protected Repository $config;
26-
27-
public function __construct(LoggerInterface $logger, Repository $config)
28-
{
29-
$this->logger = $logger;
30-
$this->config = $config;
31-
}
24+
public function __construct(
25+
private readonly LoggerInterface $logger,
26+
private readonly Repository $config,
27+
) {}
3228

3329
public function handle(QueryExecuted $event): void
3430
{

src/QueryLogger/QueryLoggerServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class QueryLoggerServiceProvider extends ServiceProvider
1111
{
12-
public function boot(Repository $config, Dispatcher $events)
12+
public function boot(Repository $config, Dispatcher $events): void
1313
{
1414
if ($config->get('app.debug') === true) {
1515
$events->listen(QueryExecuted::class, QueryLogger::class);

0 commit comments

Comments
 (0)