Skip to content

Commit

Permalink
fix: added errors to ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislarsen committed Dec 10, 2024
1 parent 54d5212 commit 539d794
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 9 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,13 @@ parameters:
# This is a particularly nasty error and I couldn't manage to resolve it (nicely)..
- '#Cannot call method isoFormat\(\) on (.*)Carbon(.*)string#'

# Blanket ignores for specific PHPStan errors
- '#Generic type Illuminate\\Database\\Eloquent\\Relations\\HasOne<(.*)> in PHPDoc tag @return does not specify all template types of class Illuminate\\Database\\Eloquent\\Relations\\HasOne: TRelatedModel, TDeclaringModel#'
- '#Method App\\Models\\BackupTask::latestLog\(\) should return Illuminate\\Database\\Eloquent\\Relations\\HasOne<(.*)> but returns Illuminate\\Database\\Eloquent\\Relations\\HasOne<(.*)>#'
- '#Generic type Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany<(.*)> in PHPDoc tag @return does not specify all template types of class Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany: TRelatedModel, TDeclaringModel#'
- '#Method App\\Models\\BackupTask::notificationStreams\(\) should return Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany<(.*)> but returns Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany<(.*)>#'
- '#Method App\\Models\\NotificationStream::backupTasks\(\) should return Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany<(.*)> but returns Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany<(.*)>#'
- '#Method App\\Models\\Taggable::taggable\(\) should return Illuminate\\Database\\Eloquent\\Relations\\MorphTo<(.*)> but returns Illuminate\\Database\\Eloquent\\Relations\\MorphTo<(.*)>#'


treatPhpDocTypesAsCertain: false
3 changes: 1 addition & 2 deletions tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
|
*/

expect()->extend('toBeOne', fn() => $this->toBe(1));
expect()->extend('toBeOne', fn () => $this->toBe(1));

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -109,4 +109,3 @@ function createUserWithBackupTaskAndDependencies(): array
'backupDestination' => $backupDestination,
];
}

0 comments on commit 539d794

Please sign in to comment.