Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 解决 PHPStan 错误 并开启 PHPStan 充血模式 #49

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/Actions/Jetstream/CreateTeam.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function create(User $user, array $input): Team
'name' => $input['name'],
'personal_team' => false,
]));
assert($team instanceof Team);

return $team;
}
Expand Down
4 changes: 1 addition & 3 deletions app/Actions/Jetstream/DeleteUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ class DeleteUser implements DeletesUsers
/**
* Create a new action instance.
*/
public function __construct(protected DeletesTeams $deletesTeams)
{
}
public function __construct(protected DeletesTeams $deletesTeams) {}

/**
* Delete the given user.
Expand Down
2 changes: 2 additions & 0 deletions app/Actions/Jetstream/InviteTeamMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Actions\Jetstream;

use App\Models\Team;
use App\Models\TeamInvitation as TeamInvitationModel;
use App\Models\User;
use Closure;
use Illuminate\Database\Query\Builder;
Expand Down Expand Up @@ -36,6 +37,7 @@ public function invite(User $user, Team $team, string $email, ?string $role = nu
'role' => $role,
]);

assert($invitation instanceof TeamInvitationModel);
Mail::to($email)->send(new TeamInvitation($invitation));
}

Expand Down
8 changes: 6 additions & 2 deletions app/Enums/CacheEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ enum CacheEnum: string
// 警告:方法名不能相同
case AUTHORIZATION_USER = 'authorizationUser'; // 将调用下面定义的 authorizationUser 方法获取缓存过期时间

// 授权用户信息过期时间定义:将在 Jwt token 过期时一同失效
private static function authorizationUser()
/**
* @description 授权用户信息过期时间定义:将在 Jwt token 过期时一同失效
*
* @phpstan-ignore method.unused
*/
private static function authorizationUser(): float
{
$expiration = Carbon::now()->addMinutes((int) config('sanctum.expiration'));

Expand Down
4 changes: 2 additions & 2 deletions app/Models/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class Category extends Model
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
* @var list<string>
*/
protected $fillable = ['name', 'is_directory', 'level', 'path', 'state', 'order', 'parent_id'];

/**
* The accessors to append to the model's array form.
*
* @var array<int, string>
* @var list<string>
*/
protected $appends = ['path_ids', 'ancestors', 'full_name'];

Expand Down
2 changes: 1 addition & 1 deletion app/Models/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Label extends Model
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
* @var list<string>
*/
protected $fillable = [
'name',
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Team extends JetstreamTeam
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
* @var list<string>
*/
protected $fillable = [
'name',
Expand Down
6 changes: 3 additions & 3 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class User extends Authenticatable implements FilamentUser, HasAvatar, HasName
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
* @var list<string>
*/
protected $fillable = [
'first_name',
Expand Down Expand Up @@ -101,7 +101,7 @@ class User extends Authenticatable implements FilamentUser, HasAvatar, HasName
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
* @var list<string>
*/
protected $hidden = [
'password',
Expand All @@ -113,7 +113,7 @@ class User extends Authenticatable implements FilamentUser, HasAvatar, HasName
/**
* The accessors to append to the model's array form.
*
* @var array<int, string>
* @var list<string>
*/
protected $appends = [
'profile_photo_url',
Expand Down
2 changes: 1 addition & 1 deletion app/Models/VerificationCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class VerificationCode extends Model
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
* @var list<string>
*/
protected $fillable = [
'key',
Expand Down
64 changes: 32 additions & 32 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,46 @@
"license": "MIT",
"require": {
"php": "^8.2",
"bezhansalleh/filament-shield": "^3.2",
"bezhansalleh/filament-shield": "^3.2.6",
"dutchcodingcompany/filament-developer-logins": "^1.4",
"filament/filament": "^3.2",
"filament/filament": "^3.2.121",
"intervention/image-laravel": "^1.3",
"jiannei/laravel-enum": "^4.0",
"jiannei/laravel-response": "^6.0",
"jiannei/laravel-enum": "^4.0.2",
"jiannei/laravel-response": "^6.0.1",
"laravel-lang/json-fallback": "^2.1",
"laravel-lang/locales": "^2.6",
"laravel/framework": "^11.0",
"laravel/horizon": "^5.23",
"laravel/jetstream": "^5.0",
"laravel/octane": "^2.4",
"laravel/pennant": "^1.11",
"laravel/pulse": "^1.2",
"laravel/sanctum": "^4.0",
"laravel/telescope": "^5.0",
"laravel/tinker": "^2.9",
"livewire/livewire": "^3.0",
"opcodesio/log-viewer": "^3.10",
"overtrue/laravel-query-logger": "^3.2",
"propaganistas/laravel-phone": "^5.3",
"laravel-lang/locales": "^2.9.2",
"laravel/framework": "^11.30",
"laravel/horizon": "^5.29.2",
"laravel/jetstream": "^5.3.1",
"laravel/octane": "^2.5.9",
"laravel/pennant": "^1.12",
"laravel/pulse": "^1.2.5",
"laravel/sanctum": "^4.0.3",
"laravel/telescope": "^5.2.4",
"laravel/tinker": "^2.10",
"livewire/livewire": "^3.5.12",
"opcodesio/log-viewer": "^3.11.2",
"overtrue/laravel-query-logger": "^3.3",
"propaganistas/laravel-phone": "^5.3.2",
"spiral/roadrunner-cli": "^2.6.0",
"spiral/roadrunner-http": "^3.3.0",
"stephenjude/filament-debugger": "^3.1",
"spiral/roadrunner-http": "^3.5.1",
"stephenjude/filament-debugger": "^3.1.2",
"stephenjude/filament-feature-flags": "^2.1",
"whichbrowser/parser": "^2.1"
"whichbrowser/parser": "^2.1.8"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^3.0",
"fakerphp/faker": "^1.23",
"larastan/larastan": "^2.9",
"laravel-lang/common": "^6.2",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"barryvdh/laravel-ide-helper": "^3.2.2",
"fakerphp/faker": "^1.23.1",
"larastan/larastan": "^2.9.9",
"laravel-lang/common": "^6.4",
"laravel/pint": "^1.18.1",
"laravel/sail": "^1.37.1",
"mockery/mockery": "^1.6.12",
"nunomaduro/collision": "^8.5",
"pestphp/pest": "^2.36",
"pestphp/pest-plugin-laravel": "^2.4",
"spatie/laravel-horizon-watcher": "^1.1",
"spatie/laravel-ignition": "^2.4"
"spatie/laravel-ignition": "^2.8"
},
"autoload": {
"psr-4": {
Expand Down
Loading