You've already forked Atomcms-edit
chore: improve code quality - PHPStan level 5, add #[\Override] attributes, fix return types
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
Executable
+2569
File diff suppressed because it is too large
Load Diff
+2
-4
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user