chore: improve code quality - PHPStan level 5, add #[\Override] attributes, fix return types

This commit is contained in:
root
2026-05-23 18:44:16 +02:00
parent 6de250f49f
commit 7e8313a55b
6 changed files with 2581 additions and 4 deletions
@@ -48,6 +48,8 @@ class GuestbookController extends Controller
if ($user->profileGuestbook()->where('user_id', $request->user()->id)->count() >= $maxAllowedPostCount) {
return $this->redirectWithError(__('You have already posted :count messages on this profile.', ['count' => $maxAllowedPostCount]));
}
return null;
}
private function redirectWithError(string $message): RedirectResponse
+3
View File
@@ -6,8 +6,10 @@ use Illuminate\Database\Eloquent\Model;
class EmailTemplate extends Model
{
#[\Override]
protected $table = 'email_templates';
#[\Override]
protected $fillable = [
'name',
'subject',
@@ -16,6 +18,7 @@ class EmailTemplate extends Model
'is_active',
];
#[\Override]
protected $casts = [
'is_active' => 'boolean',
];
+2
View File
@@ -7,8 +7,10 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
class SocialAccount extends Model
{
#[\Override]
protected $table = 'social_accounts';
#[\Override]
protected $fillable = [
'user_id',
'provider',
+3
View File
@@ -7,8 +7,10 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
class StaffActivity extends Model
{
#[\Override]
protected $table = 'staff_activities';
#[\Override]
protected $fillable = [
'user_id',
'action',
@@ -19,6 +21,7 @@ class StaffActivity extends Model
'metadata',
];
#[\Override]
protected $casts = [
'metadata' => 'array',
'created_at' => 'datetime',