Skip to content

Commit d0f9500

Browse files
committed
fix(phpstan):(LAR-105) fixing phpstan error
1 parent 2ab0980 commit d0f9500

File tree

19 files changed

+26
-19
lines changed

19 files changed

+26
-19
lines changed

app/Filament/Resources/ArticleResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class ArticleResource extends Resource
2525

2626
protected static ?string $navigationIcon = 'heroicon-o-newspaper';
2727

28-
public static function getNavigationGroup(): ?string
28+
public static function getNavigationGroup(): string
2929
{
3030
return __('Contenu');
3131
}

app/Filament/Resources/ArticleResource/Pages/ListArticles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class ListArticles extends ListRecords
1313
{
1414
protected static string $resource = ArticleResource::class;
1515

16-
public function isTableRecordSelectable(): ?Closure
16+
public function isTableRecordSelectable(): Closure
1717
{
1818
return fn (Article $record): bool => $record->isNotPublished();
1919
}

app/Filament/Resources/ChannelResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class ChannelResource extends Resource
2323

2424
protected static ?string $navigationIcon = 'untitledui-git-branch';
2525

26-
public static function getNavigationGroup(): ?string
26+
public static function getNavigationGroup(): string
2727
{
2828
return __('Forum');
2929
}

app/Filament/Resources/DiscussionResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ final class DiscussionResource extends Resource
1818

1919
protected static ?string $navigationIcon = 'untitledui-message-chat-square';
2020

21-
public static function getNavigationGroup(): ?string
21+
public static function getNavigationGroup(): string
2222
{
2323
return __('Contenu');
2424
}

app/Filament/Resources/TagResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class TagResource extends Resource
2020

2121
protected static ?string $navigationIcon = 'untitledui-tag-03';
2222

23-
public static function getNavigationGroup(): ?string
23+
public static function getNavigationGroup(): string
2424
{
2525
return __('Contenu');
2626
}

app/Filament/Resources/UserResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class UserResource extends Resource
2323

2424
protected static ?string $navigationIcon = 'untitledui-users-02';
2525

26-
public static function getNavigationGroup(): ?string
26+
public static function getNavigationGroup(): string
2727
{
2828
return __('Management');
2929
}

app/Livewire/Components/Forum/ReplyForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function open(?int $replyId = null): void
4141
{
4242
$this->reply = Reply::query()->find($replyId);
4343

44-
$this->form->fill(['body' => $this->reply?->body ?? '']);
44+
$this->form->fill(['body' => $this->reply->body ?? '']);
4545

4646
$this->show = true;
4747
}

app/Livewire/Modals/Unsplash.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ public static function modalMaxWidth(): string
2020

2121
public function render(): View
2222
{
23-
return view('livewire.modals.unsplash');
23+
return view('livewire.modals.unsplash'); // @phpstan-ignore-line
2424
}
2525
}

app/Mail/NewReplyEmail.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public function __construct(
2121

2222
public function build(): self
2323
{
24-
// @phpstan-ignore-next-line
2524
return $this->subject("Re: {$this->reply->replyAble->subject()}")
2625
->markdown('emails.new_reply');
2726
}

app/Models/Discussion.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ final class Discussion extends Model implements ReactableInterface, ReplyInterfa
6868
];
6969

7070
protected $appends = [
71+
// @phpstan-ignore-next-line
7172
'count_all_replies_with_child',
7273
];
7374

app/Models/User.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ final class User extends Authenticatable implements FilamentUser, HasAvatar, Has
105105
public function hasProvider(string $provider): bool
106106
{
107107
foreach ($this->providers as $p) {
108-
if ($p->provider === $provider) {
108+
if ($p->provider === $provider) { // @phpstan-ignore-line
109109
return true;
110110
}
111111
}
@@ -183,7 +183,7 @@ public function getFilamentAvatarUrl(): ?string
183183
}
184184

185185
/**
186-
* @return array{name: string, username: string, picture: string}
186+
* @return array{name: string, username: string, picture: string|null}
187187
*/
188188
public function profile(): array
189189
{
@@ -343,6 +343,7 @@ public function hasPassword(): bool
343343
{
344344
$password = $this->getAuthPassword();
345345

346+
// @phpstan-ignore-next-line
346347
return $password !== '' && $password !== null;
347348
}
348349

@@ -382,12 +383,12 @@ public function countReplies(): int
382383

383384
public function countSolutions(): int
384385
{
385-
return $this->replyAble()->isSolution()->count();
386+
return $this->replyAble()->isSolution()->count(); // @phpstan-ignore-line
386387
}
387388

388389
public function countArticles(): int
389390
{
390-
return $this->articles()->approved()->count();
391+
return $this->articles()->approved()->count(); // @phpstan-ignore-line
391392
}
392393

393394
public function countDiscussions(): int

app/Policies/NotificationPolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ final class NotificationPolicy
1616

1717
public function markAsRead(User $user, DatabaseNotification $notification): bool
1818
{
19-
return $notification->notifiable->is($user); // @phpstan-ignore-line
19+
return $notification->notifiable->is($user);
2020
}
2121
}

app/Spotlight/Article.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class Article extends SpotlightCommand
2020

2121
protected array $synonyms = [];
2222

23-
public function dependencies(): ?SpotlightCommandDependencies
23+
public function dependencies(): SpotlightCommandDependencies
2424
{
2525
return SpotlightCommandDependencies::collection()
2626
->add(

app/Spotlight/Discussion.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class Discussion extends SpotlightCommand
2020

2121
protected array $synonyms = [];
2222

23-
public function dependencies(): ?SpotlightCommandDependencies
23+
public function dependencies(): SpotlightCommandDependencies
2424
{
2525
return SpotlightCommandDependencies::collection()
2626
->add(

app/Spotlight/Sujet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class Sujet extends SpotlightCommand
2525
'thread',
2626
];
2727

28-
public function dependencies(): ?SpotlightCommandDependencies
28+
public function dependencies(): SpotlightCommandDependencies
2929
{
3030
return SpotlightCommandDependencies::collection()
3131
->add(

app/Spotlight/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class User extends SpotlightCommand
2020

2121
protected array $synonyms = [];
2222

23-
public function dependencies(): ?SpotlightCommandDependencies
23+
public function dependencies(): SpotlightCommandDependencies
2424
{
2525
return SpotlightCommandDependencies::collection()
2626
->add(

app/Traits/HasReplies.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function isConversationOld(): bool
5454
$sixMonthsAgo = now()->subMonths(6);
5555

5656
if ($reply = $this->replies()->latest()->first()) {
57-
/** @var $reply Reply */
57+
/** @var Reply $reply */
5858
return $reply->created_at->lt($sixMonthsAgo);
5959
}
6060

app/Traits/HasSocialite.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Laravel\Socialite\Contracts\User;
99
use Laravel\Socialite\Facades\Socialite;
1010

11+
/**
12+
* @phpstan-ignore trait.unused
13+
*/
1114
trait HasSocialite
1215
{
1316
/**

app/Traits/UserResponse.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use App\Http\Resources\EnterpriseResource;
99
use App\Models\User;
1010

11+
/**
12+
* @phpstan-ignore trait.unused
13+
*/
1114
trait UserResponse
1215
{
1316
/**

0 commit comments

Comments
 (0)