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 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/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..9813f3a --- /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\.#' 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);