diff --git a/app/Nova/Resource.php b/app/Nova/Resource.php index 9f8e30dc..49983c81 100755 --- a/app/Nova/Resource.php +++ b/app/Nova/Resource.php @@ -56,8 +56,8 @@ public static function indexQuery(NovaRequest $request, $query) * Build a "detail" query for the given resource. * * @param \Laravel\Nova\Http\Requests\NovaRequest $request - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder + * @param \Illuminate\Contracts\Database\Eloquent\Builder $query + * @return \Illuminate\Contracts\Database\Eloquent\Builder */ public static function detailQuery(NovaRequest $request, $query) { diff --git a/app/Nova/Subscriber.php b/app/Nova/Subscriber.php index 02d033c6..63bb67ad 100644 --- a/app/Nova/Subscriber.php +++ b/app/Nova/Subscriber.php @@ -94,7 +94,7 @@ public function fields(NovaRequest $request): array 'active' => 'success', ])->label(function ($value) { return Str::title($value); - })->filterable(function ($request, $query, $value) { + })->filterable(function ($request, $query, $value) { // @phpstan-ignore argument.type return $query->when($value === 'active', function ($query) { $query->whereNotNull('email_verified_at'); })->when($value === 'inactive', function ($query) { diff --git a/app/Providers/NovaServiceProvider.php b/app/Providers/NovaServiceProvider.php index f6976231..6a2b0759 100644 --- a/app/Providers/NovaServiceProvider.php +++ b/app/Providers/NovaServiceProvider.php @@ -84,7 +84,7 @@ function ($command) { new Prompts\ConfirmPrompt(label: 'Active', default: false, required: true), ]; }, - function (string $name, string $email, string $password, bool $active) { + function (string $name, string $email, string $password, bool $active) { // @phpstan-ignore argument.type /** @var class-string<\Illuminate\Database\Eloquent\Model> $model */ $model = Util::userModel(); @@ -199,7 +199,6 @@ public function registerActionMacros() public function registerFieldMacros() { Hidden::macro('trackSelectedResources', function (string $from) { - /** @phpstan-ignore-next-line */ $this->dependsOn($from, function (Hidden $field, NovaRequest $request, FormData $formData) use ($from) { $bool = $formData->get($from, false) === true ? 'true' : 'false'; @@ -219,12 +218,10 @@ public function registerFieldMacros() }); Field::macro('showWhen', function (bool $condition) { - /** @phpstan-ignore-next-line */ return $condition === true ? $this->show() : $this->hide(); }); Field::macro('showUnless', function (bool $condition) { - /** @phpstan-ignore-next-line */ return $condition === true ? $this->hide() : $this->show(); }); } diff --git a/nova-components/IconsViewer/src/Console/GeneratesIconCommand.php b/nova-components/IconsViewer/src/Console/GeneratesIconCommand.php index fccaae5b..ec8ff4f0 100644 --- a/nova-components/IconsViewer/src/Console/GeneratesIconCommand.php +++ b/nova-components/IconsViewer/src/Console/GeneratesIconCommand.php @@ -43,7 +43,7 @@ public function handle(Filesystem $files) }) ->collect() ->reject(fn ($file) => Str::endsWith($file, 'd.ts') || Str::endsWith($file, ['index.js', 'package.json'])) - ->transform(function ($file) use ($directory) { + ->transform(function ($file) use ($directory) { // @phpstan-ignore argument.type /** @var string $file */ return Str::snake( str_replace(['Icon.js', '/'], ['', ''], Str::after($file, $directory)), '-' diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 2e2b22be..d627a2d6 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -29,8 +29,3 @@ parameters: message: "#^Parameter \\#1 \\$callback of method Illuminate\\\\Support\\\\Collection\\\\:\\:transform\\(\\) expects callable\\(Symfony\\\\Component\\\\Finder\\\\SplFileInfo, string\\)\\: Symfony\\\\Component\\\\Finder\\\\SplFileInfo, Closure\\(mixed\\)\\: string given\\.$#" count: 1 path: nova-components/IconsViewer/src/Http/Controllers/ViewerController.php - - - - message: "#^Strict comparison using \\=\\=\\= between Symfony\\\\Component\\\\Finder\\\\SplFileInfo and 'index\\.js' will always evaluate to false\\.$#" - count: 1 - path: nova-components/IconsViewer/src/Http/Controllers/ViewerController.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index aae6bfd0..5bf3ccfe 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -14,16 +14,16 @@ parameters: - nova-components/SidebarTool/src # The level 9 is the highest level - level: 6 + level: 5 ignoreErrors: + # - identifier: missingType.generics + # - identifier: missingType.iterableValue - '#Access to an undefined property Laravel\\Nova\\Fields\\(ActionFields|FormData)#' - '#Call to an undefined method Illuminate\\Database\\Eloquent\\[a-zA-Z\\\<\>]+::(withTrashed|onlyTrashed|trashed)\(\)#' excludePaths: - app/Http/Controllers/Auth/*.php - checkMissingIterableValueType: false noUnnecessaryCollectionCall: false checkModelProperties: false - checkGenericClassInNonGenericObjectType: false