From ffba7f79d64fda7f25e7c8d743b7c75376dd96ee Mon Sep 17 00:00:00 2001 From: Philip Iezzi Date: Thu, 12 Sep 2024 16:27:15 +0200 Subject: [PATCH] Apply Pint style fixes (single_line_empty_body, new_with_parentheses rules) --- src/Config.php | 3 +-- src/Events/QueryLogWritten.php | 3 +-- src/FileName.php | 3 +-- src/Formatter.php | 3 +-- src/Listeners/LogSqlQuery.php | 3 +-- src/SqlLogger.php | 5 ++--- src/SqlQuery.php | 3 +-- src/Writer.php | 3 +-- tests/Feature/WriterTest.php | 2 +- 9 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/Config.php b/src/Config.php index 5cc3df7..0e8c372 100644 --- a/src/Config.php +++ b/src/Config.php @@ -8,8 +8,7 @@ class Config { public function __construct( protected ConfigRepository $repository - ) { - } + ) {} /** * Get directory where log files should be saved. diff --git a/src/Events/QueryLogWritten.php b/src/Events/QueryLogWritten.php index 739ea3a..435474f 100644 --- a/src/Events/QueryLogWritten.php +++ b/src/Events/QueryLogWritten.php @@ -12,6 +12,5 @@ public function __construct( public int $loggedQueryCount, public string $reportHeader, public array $reportQueries, - ) { - } + ) {} } diff --git a/src/FileName.php b/src/FileName.php index 58d81ff..0940854 100644 --- a/src/FileName.php +++ b/src/FileName.php @@ -10,8 +10,7 @@ class FileName public function __construct( private Container $app, private Config $config - ) { - } + ) {} /** * Create file name for query log. diff --git a/src/Formatter.php b/src/Formatter.php index 7654f04..d66e1b7 100644 --- a/src/Formatter.php +++ b/src/Formatter.php @@ -14,8 +14,7 @@ class Formatter public function __construct( private Container $app, private Config $config - ) { - } + ) {} /** * Get formatted single query line(s). diff --git a/src/Listeners/LogSqlQuery.php b/src/Listeners/LogSqlQuery.php index ddaf15e..7d575e7 100644 --- a/src/Listeners/LogSqlQuery.php +++ b/src/Listeners/LogSqlQuery.php @@ -14,8 +14,7 @@ */ public function __construct( private SqlLogger $logger, - ) { - } + ) {} /** * Handle the event. diff --git a/src/SqlLogger.php b/src/SqlLogger.php index 17aae38..2e7f0db 100644 --- a/src/SqlLogger.php +++ b/src/SqlLogger.php @@ -5,15 +5,14 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; -class SqlLogger +readonly class SqlLogger { /** * SqlLogger constructor. */ public function __construct( private Writer $writer - ) { - } + ) {} /** * Log queries diff --git a/src/SqlQuery.php b/src/SqlQuery.php index 61dd70b..0adcd16 100644 --- a/src/SqlQuery.php +++ b/src/SqlQuery.php @@ -10,8 +10,7 @@ public function __construct( public float $time, public string $query, public array $bindings = [] - ) { - } + ) {} public static function make( int $number, diff --git a/src/Writer.php b/src/Writer.php index 4ebee88..d300773 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -32,8 +32,7 @@ public function __construct( private readonly Formatter $formatter, private readonly Config $config, private readonly FileName $fileName - ) { - } + ) {} /** * Set callback to determine whether query should be reported. diff --git a/tests/Feature/WriterTest.php b/tests/Feature/WriterTest.php index af2bf14..5cd38d6 100644 --- a/tests/Feature/WriterTest.php +++ b/tests/Feature/WriterTest.php @@ -19,7 +19,7 @@ $this->writer = new Writer($this->formatter, $this->config, $this->filename); $this->directory = __DIR__.'/test-dir/directory'; setConfig('general.directory', $this->directory); - $this->filesystem = new Filesystem(); + $this->filesystem = new Filesystem; }); afterEach(function () {