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) { 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 $this->redirectWithError(__('You have already posted :count messages on this profile.', ['count' => $maxAllowedPostCount]));
} }
return null;
} }
private function redirectWithError(string $message): RedirectResponse private function redirectWithError(string $message): RedirectResponse
+3
View File
@@ -6,8 +6,10 @@ use Illuminate\Database\Eloquent\Model;
class EmailTemplate extends Model class EmailTemplate extends Model
{ {
#[\Override]
protected $table = 'email_templates'; protected $table = 'email_templates';
#[\Override]
protected $fillable = [ protected $fillable = [
'name', 'name',
'subject', 'subject',
@@ -16,6 +18,7 @@ class EmailTemplate extends Model
'is_active', 'is_active',
]; ];
#[\Override]
protected $casts = [ protected $casts = [
'is_active' => 'boolean', 'is_active' => 'boolean',
]; ];
+2
View File
@@ -7,8 +7,10 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
class SocialAccount extends Model class SocialAccount extends Model
{ {
#[\Override]
protected $table = 'social_accounts'; protected $table = 'social_accounts';
#[\Override]
protected $fillable = [ protected $fillable = [
'user_id', 'user_id',
'provider', 'provider',
+3
View File
@@ -7,8 +7,10 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
class StaffActivity extends Model class StaffActivity extends Model
{ {
#[\Override]
protected $table = 'staff_activities'; protected $table = 'staff_activities';
#[\Override]
protected $fillable = [ protected $fillable = [
'user_id', 'user_id',
'action', 'action',
@@ -19,6 +21,7 @@ class StaffActivity extends Model
'metadata', 'metadata',
]; ];
#[\Override]
protected $casts = [ protected $casts = [
'metadata' => 'array', 'metadata' => 'array',
'created_at' => 'datetime', 'created_at' => 'datetime',
+2569
View File
File diff suppressed because it is too large Load Diff
+2 -4
View File
@@ -1,10 +1,8 @@
includes: includes:
# - vendor/phpstan/phpstan/conf/bleedingEdge.neon - phpstan-baseline.neon
parameters: parameters:
level: 3 level: 5
paths: paths:
- app - app
excludePaths:
- app/Helpers/helper.php
reportUnmatchedIgnoredErrors: false reportUnmatchedIgnoredErrors: false