From 99cfeccb72d5d1c544e05f9dcd21ee8e29ac847a Mon Sep 17 00:00:00 2001 From: Italo Israel Baeza Cabrera Date: Tue, 28 Jan 2025 20:20:18 -0300 Subject: [PATCH 1/4] PHP 8.4 support --- .github/workflows/php.yml | 1 + src/BootHelpers.php | 4 ++-- src/Http/Middleware/MiddlewareDeclaration.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f33d577..49519a0 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -55,6 +55,7 @@ jobs: - 8.1 - 8.2 - 8.3 + - 8.4 laravel-constraint: - 10.* - 11.* diff --git a/src/BootHelpers.php b/src/BootHelpers.php index dc3d920..ed17e30 100644 --- a/src/BootHelpers.php +++ b/src/BootHelpers.php @@ -24,7 +24,7 @@ trait BootHelpers * @param callable|string|null $callback * @return void */ - protected function withDriver(string $service, string|array $driver, callable|string $callback = null): void + protected function withDriver(string $service, string|array $driver, callable|string|null $callback = null): void { if (is_string($driver)) { $driver = [$driver => $callback]; @@ -49,7 +49,7 @@ protected function withDriver(string $service, string|array $driver, callable|st protected function withValidationRule( string $rule, callable|string $callback, - callable|string $message = null, + callable|string|null $message = null, bool $implicit = false ): void { $this->callAfterResolving( diff --git a/src/Http/Middleware/MiddlewareDeclaration.php b/src/Http/Middleware/MiddlewareDeclaration.php index 8d489e4..497b397 100644 --- a/src/Http/Middleware/MiddlewareDeclaration.php +++ b/src/Http/Middleware/MiddlewareDeclaration.php @@ -89,7 +89,7 @@ public function last(): void * @param (callable(\Illuminate\Contracts\Foundation\Application):TValue)|null $callback * @return $this */ - public function shared(callable $callback = null): static + public function shared(?callable $callback = null): static { $this->kernel->getApplication()->singleton($this->middleware, $callback); From b0a21560af6835c2ad6438f55ecb216a389479a2 Mon Sep 17 00:00:00 2001 From: Italo Israel Baeza Cabrera Date: Tue, 28 Jan 2025 21:18:12 -0300 Subject: [PATCH 2/4] Omit unused trait errors. --- phpstan.neon | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 phpstan.neon diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..02dd131 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + ignoreErrors: + - '#Trait Laragear\\Meta\BootHelpers is used zero times and is not analysed\.#' + - '#Trait Laragear\\Meta\\Console\\Commands\\WithEnvironmentFile is used zero times and is not analysed\.#' + - '#Trait Laragear\\Meta\\Database\\Eloquent\\ExtendsBuilder is used zero times and is not analysed\.#' From 717d0d5f0a32011ecbd8f7f88663a41100f9a389 Mon Sep 17 00:00:00 2001 From: Italo Israel Baeza Cabrera Date: Tue, 28 Jan 2025 21:24:50 -0300 Subject: [PATCH 3/4] Fixes ignore trait pattern --- phpstan.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan.neon b/phpstan.neon index 02dd131..9813f3a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,5 @@ parameters: ignoreErrors: - - '#Trait Laragear\\Meta\BootHelpers is used zero times and is not analysed\.#' + - '#Trait Laragear\\Meta\\BootHelpers is used zero times and is not analysed\.#' - '#Trait Laragear\\Meta\\Console\\Commands\\WithEnvironmentFile is used zero times and is not analysed\.#' - '#Trait Laragear\\Meta\\Database\\Eloquent\\ExtendsBuilder is used zero times and is not analysed\.#' From d0cc5e86e3d1404289c0fba267d1396403d94de0 Mon Sep 17 00:00:00 2001 From: Italo Israel Baeza Cabrera Date: Tue, 28 Jan 2025 21:25:18 -0300 Subject: [PATCH 4/4] Adds PHPStan config to export ignore --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index e509729..8da2d2e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,3 +10,4 @@ /phpunit.xml export-ignore /tests export-ignore /.editorconfig export-ignore +/phpstan.neon export-ignore