diff --git a/api/app/Console/Commands/CheckIntl.php b/api/app/Console/Commands/CheckIntl.php index 7fcbd24c1d4..85921a91fae 100644 --- a/api/app/Console/Commands/CheckIntl.php +++ b/api/app/Console/Commands/CheckIntl.php @@ -3,7 +3,6 @@ namespace App\Console\Commands; use App\Discoverers\EnumDiscoverer; -use App\Traits\HasLocalization; use Illuminate\Console\Command; use Illuminate\Support\Arr; use Illuminate\Support\Facades\Lang; @@ -79,7 +78,6 @@ public function handle() { $this->localizedEnums = EnumDiscoverer::discoverLocalizedEnums(); - /** @var HasLocalization $enum */ foreach ($this->localizedEnums as $enum) { $this->checkStrings($enum); } diff --git a/api/app/Policies/ClassificationPolicy.php b/api/app/Policies/ClassificationPolicy.php index 13333d0adcf..3b47e4c5d9b 100644 --- a/api/app/Policies/ClassificationPolicy.php +++ b/api/app/Policies/ClassificationPolicy.php @@ -26,7 +26,6 @@ public function viewAny(?User $user) * * Note: This action is possible for everyone, including anonymous users * - * @param \App\Models\Classification $classification * @return \Illuminate\Auth\Access\Response|bool */ public function view(?User $user) @@ -47,7 +46,6 @@ public function create(User $user) /** * Determine whether the user can update the model. * - * @param \App\Models\Classification $classification * @return \Illuminate\Auth\Access\Response|bool */ public function update(User $user) @@ -58,7 +56,6 @@ public function update(User $user) /** * Determine whether the user can delete the model. * - * @param \App\Models\Classification $classification * @return \Illuminate\Auth\Access\Response|bool */ public function delete(User $user) @@ -69,7 +66,6 @@ public function delete(User $user) /** * Determine whether the user can restore the model. * - * @param \App\Models\Classification $classification * @return \Illuminate\Auth\Access\Response|bool */ public function restore(User $user) @@ -80,7 +76,6 @@ public function restore(User $user) /** * Determine whether the user can permanently delete the model. * - * @param \App\Models\Classification $classification * @return \Illuminate\Auth\Access\Response|bool */ public function forceDelete(User $user) diff --git a/api/app/Policies/CommunityPolicy.php b/api/app/Policies/CommunityPolicy.php index ce0d21af80b..5c41c921830 100644 --- a/api/app/Policies/CommunityPolicy.php +++ b/api/app/Policies/CommunityPolicy.php @@ -44,7 +44,6 @@ public function create(User $user) /** * Determine whether the user can update models. * - * @param \App\Models\Community|null $community * @return \Illuminate\Auth\Access\Response|bool */ public function update(User $user, Community $community) @@ -55,7 +54,6 @@ public function update(User $user, Community $community) /** * Determine whether the user can view the team members of a specific communities team * - * @param \App\Models\Community|null $community * @return \Illuminate\Auth\Access\Response|bool */ public function viewTeamMembers(User $user, Community $community) diff --git a/api/app/Policies/DepartmentPolicy.php b/api/app/Policies/DepartmentPolicy.php index 77250759401..b248a8044ea 100644 --- a/api/app/Policies/DepartmentPolicy.php +++ b/api/app/Policies/DepartmentPolicy.php @@ -26,7 +26,6 @@ public function viewAny(?User $user) * * Note: This action is possible for everyone, including anonymous users * - * @param \App\Models\Department $department * @return \Illuminate\Auth\Access\Response|bool */ public function view(?User $user) @@ -47,7 +46,6 @@ public function create(User $user) /** * Determine whether the user can update the model. * - * @param \App\Models\Department $department * @return \Illuminate\Auth\Access\Response|bool */ public function update(User $user) @@ -58,7 +56,6 @@ public function update(User $user) /** * Determine whether the user can delete the model. * - * @param \App\Models\Department $department * @return \Illuminate\Auth\Access\Response|bool */ public function delete(User $user) @@ -69,7 +66,6 @@ public function delete(User $user) /** * Determine whether the user can restore the model. * - * @param \App\Models\Department $department * @return \Illuminate\Auth\Access\Response|bool */ public function restore(User $user) @@ -80,7 +76,6 @@ public function restore(User $user) /** * Determine whether the user can permanently delete the model. * - * @param \App\Models\Department $department * @return \Illuminate\Auth\Access\Response|bool */ public function forceDelete(User $user) diff --git a/api/app/Policies/GenericJobTitlePolicy.php b/api/app/Policies/GenericJobTitlePolicy.php index 9c61a428fc7..d1711973f35 100644 --- a/api/app/Policies/GenericJobTitlePolicy.php +++ b/api/app/Policies/GenericJobTitlePolicy.php @@ -26,7 +26,6 @@ public function viewAny(?User $user) * * Note: This action is possible for everyone, including anonymous users * - * @param \App\Models\Classification $classification * @return \Illuminate\Auth\Access\Response|bool */ public function view(?User $user) @@ -47,7 +46,6 @@ public function create(User $user) /** * Determine whether the user can update the model. * - * @param \App\Models\Classification $classification * @return \Illuminate\Auth\Access\Response|bool */ public function update(User $user) @@ -58,7 +56,6 @@ public function update(User $user) /** * Determine whether the user can delete the model. * - * @param \App\Models\Classification $classification * @return \Illuminate\Auth\Access\Response|bool */ public function delete(User $user) @@ -69,7 +66,6 @@ public function delete(User $user) /** * Determine whether the user can restore the model. * - * @param \App\Models\Classification $classification * @return \Illuminate\Auth\Access\Response|bool */ public function restore(User $user) @@ -80,7 +76,6 @@ public function restore(User $user) /** * Determine whether the user can permanently delete the model. * - * @param \App\Models\Classification $classification * @return \Illuminate\Auth\Access\Response|bool */ public function forceDelete(User $user) diff --git a/api/app/Policies/PoolCandidatePolicy.php b/api/app/Policies/PoolCandidatePolicy.php index 5df1c7fad91..6a0ee214576 100644 --- a/api/app/Policies/PoolCandidatePolicy.php +++ b/api/app/Policies/PoolCandidatePolicy.php @@ -144,7 +144,6 @@ public function suspend(User $user, PoolCandidate $poolCandidate) * Note: Everyone needs to be able to count applicants * for now * - * @param \App\Models\PoolCandidate $poolCandidate * @return \Illuminate\Auth\Access\Response|bool */ public function count() diff --git a/api/app/Policies/RolePolicy.php b/api/app/Policies/RolePolicy.php index 594350ffd3a..aa38a81a221 100644 --- a/api/app/Policies/RolePolicy.php +++ b/api/app/Policies/RolePolicy.php @@ -13,7 +13,6 @@ class RolePolicy /** * Determine whether the user can view any models. * - * @param \App\Models\User|null $user * @return \Illuminate\Auth\Access\Response|bool */ public function viewAny(User $user) @@ -35,8 +34,6 @@ public function viewAnyRoleAssignments(User $user) /** * Determine whether the user can view a specific role * - * @param \App\Models\User|null $user - * @param \App\Models\Role|null $role * @return \Illuminate\Auth\Access\Response|bool */ public function view(User $user) @@ -47,8 +44,6 @@ public function view(User $user) /** * Determine whether the user can update a specific role * - * @param \App\Models\User|null $user - * @param \App\Models\Role|null $role * @return \Illuminate\Auth\Access\Response|bool */ public function update(User $user) diff --git a/api/app/Policies/SkillFamilyPolicy.php b/api/app/Policies/SkillFamilyPolicy.php index 2ec2f580e9d..7377720ed19 100644 --- a/api/app/Policies/SkillFamilyPolicy.php +++ b/api/app/Policies/SkillFamilyPolicy.php @@ -26,7 +26,6 @@ public function viewAny(?User $user) * * Note: This action is possible for everyone, including anonymous users * - * @param \App\Models\SkillFamily $skillFamily * @return \Illuminate\Auth\Access\Response|bool */ public function view(?User $user) @@ -47,7 +46,6 @@ public function create(User $user) /** * Determine whether the user can update the model. * - * @param \App\Models\SkillFamily $skillFamily * @return \Illuminate\Auth\Access\Response|bool */ public function update(User $user) @@ -58,7 +56,6 @@ public function update(User $user) /** * Determine whether the user can delete the model. * - * @param \App\Models\SkillFamily $skillFamily * @return \Illuminate\Auth\Access\Response|bool */ public function delete(User $user) @@ -69,7 +66,6 @@ public function delete(User $user) /** * Determine whether the user can restore the model. * - * @param \App\Models\SkillFamily $skillFamily * @return \Illuminate\Auth\Access\Response|bool */ public function restore(User $user) @@ -80,7 +76,6 @@ public function restore(User $user) /** * Determine whether the user can permanently delete the model. * - * @param \App\Models\SkillFamily $skillFamily * @return \Illuminate\Auth\Access\Response|bool */ public function forceDelete(User $user) diff --git a/api/app/Policies/SkillPolicy.php b/api/app/Policies/SkillPolicy.php index e0125bd8a45..82136bfc2df 100644 --- a/api/app/Policies/SkillPolicy.php +++ b/api/app/Policies/SkillPolicy.php @@ -26,7 +26,6 @@ public function viewAny(?User $user) * * Note: This action is possible for everyone, including anonymous users * - * @param \App\Models\Skill $skill * @return \Illuminate\Auth\Access\Response|bool */ public function view(?User $user) @@ -47,7 +46,6 @@ public function create(User $user) /** * Determine whether the user can update the model. * - * @param \App\Models\Skill $skill * @return \Illuminate\Auth\Access\Response|bool */ public function update(User $user) @@ -58,7 +56,6 @@ public function update(User $user) /** * Determine whether the user can delete the model. * - * @param \App\Models\Skill $skill * @return \Illuminate\Auth\Access\Response|bool */ public function delete(User $user) @@ -69,7 +66,6 @@ public function delete(User $user) /** * Determine whether the user can restore the model. * - * @param \App\Models\Skill $skill * @return \Illuminate\Auth\Access\Response|bool */ public function restore(User $user) @@ -80,7 +76,6 @@ public function restore(User $user) /** * Determine whether the user can permanently delete the model. * - * @param \App\Models\Skill $skill * @return \Illuminate\Auth\Access\Response|bool */ public function forceDelete(User $user) diff --git a/api/app/Policies/TeamPolicy.php b/api/app/Policies/TeamPolicy.php index 0814cd11341..d4ebc1c3ab0 100644 --- a/api/app/Policies/TeamPolicy.php +++ b/api/app/Policies/TeamPolicy.php @@ -67,10 +67,9 @@ public function delete(User $user) /** * Determine whether the user can view a specific teams, team members. * - * @param \App\Models\Team/null $team * @return \Illuminate\Auth\Access\Response|bool */ - public function viewTeamMembers(User $user, Team $team) + public function viewTeamMembers(User $user, ?Team $team) { return $user->isAbleTo('view-any-teamMembers') || $user->isAbleTo('view-team-teamMembers', $team); } diff --git a/api/app/Providers/GraphQLServiceProvider.php b/api/app/Providers/GraphQLServiceProvider.php index 87fc0cc28f0..d58b3edb728 100644 --- a/api/app/Providers/GraphQLServiceProvider.php +++ b/api/app/Providers/GraphQLServiceProvider.php @@ -53,8 +53,6 @@ static function () use ($name, $enum): EnumType { /** Discover all enums in the App\Enum namespace that implement the HasLocalization trait * and register them as a LocalizedEnum type in GraphQL - * - * @var array */ $localizedEnums = EnumDiscoverer::discoverLocalizedEnums(); @@ -65,6 +63,7 @@ static function () use ($name, $enum): EnumType { $resolver = function ($value, $args, $context, ResolveInfo $info) use ($enum) { switch ($info->fieldName) { case 'value': return $value; + /** @disregard P1013 Can't type hint traits */ case 'label': return $enum::localizedString($value); default: return null; } diff --git a/api/app/Providers/RouteServiceProvider.php b/api/app/Providers/RouteServiceProvider.php index 9b33775f6be..d5cbb52d7e4 100644 --- a/api/app/Providers/RouteServiceProvider.php +++ b/api/app/Providers/RouteServiceProvider.php @@ -19,15 +19,6 @@ class RouteServiceProvider extends ServiceProvider */ public const HOME = '/home'; - /** - * The controller namespace for the application. - * - * When present, controller route declarations will automatically be prefixed with this namespace. - * - * @var string|null - */ - // protected $namespace = 'App\\Http\\Controllers'; - /** * Define your route model bindings, pattern filters, etc. * diff --git a/api/phpstan.neon b/api/phpstan.neon index 522ffcf4e5a..99474957be9 100644 --- a/api/phpstan.neon +++ b/api/phpstan.neon @@ -1262,31 +1262,6 @@ parameters: count: 1 path: app/Policies/AssessmentStepPolicy.php - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$classification$#" - count: 5 - path: app/Policies/ClassificationPolicy.php - - - - message: "#^PHPDoc tag @param for parameter \\$community with type App\\\\Models\\\\Community\\|null is not subtype of native type App\\\\Models\\\\Community\\.$#" - count: 2 - path: app/Policies/CommunityPolicy.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$department$#" - count: 5 - path: app/Policies/DepartmentPolicy.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$classification$#" - count: 5 - path: app/Policies/GenericJobTitlePolicy.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$poolCandidate$#" - count: 1 - path: app/Policies/PoolCandidatePolicy.php - - message: "#^Access to an undefined property Illuminate\\\\Database\\\\Eloquent\\\\Collection\\\\|Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:\\$community\\.$#" count: 2 @@ -1302,31 +1277,6 @@ parameters: count: 1 path: app/Policies/PoolPolicy.php - - - message: "#^PHPDoc tag @param for parameter \\$user with type App\\\\Models\\\\User\\|null is not subtype of native type App\\\\Models\\\\User\\.$#" - count: 3 - path: app/Policies/RolePolicy.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$role$#" - count: 2 - path: app/Policies/RolePolicy.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$skillFamily$#" - count: 5 - path: app/Policies/SkillFamilyPolicy.php - - - - message: "#^PHPDoc tag @param references unknown parameter\\: \\$skill$#" - count: 5 - path: app/Policies/SkillPolicy.php - - - - message: "#^PHPDoc tag @param has invalid value \\(\\\\App\\\\Models\\\\Team/null \\$team\\)\\: Unexpected token \"/null\", expected variable at offset 117$#" - count: 1 - path: app/Policies/TeamPolicy.php - - message: "#^Access to offset 'id' on an unknown class App\\\\Policies\\\\UpdateUserRolesInput\\.$#" count: 2 @@ -1352,16 +1302,6 @@ parameters: count: 2 path: app/Providers/GraphQLServiceProvider.php - - - message: "#^PHPDoc tag @var above a method has no effect\\.$#" - count: 1 - path: app/Providers/RouteServiceProvider.php - - - - message: "#^PHPDoc tag @var does not specify variable name\\.$#" - count: 1 - path: app/Providers/RouteServiceProvider.php - - message: "#^Variable \\$experiences in isset\\(\\) always exists and is not nullable\\.$#" count: 1 @@ -1406,18 +1346,3 @@ parameters: message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Collection\\\\|Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:poolSkills\\(\\)\\.$#" count: 1 path: app/ValueObjects/ProfileSnapshot.php - - - - message: "#^PHPDoc tag @var for variable \\$enum has invalid type App\\\\Traits\\\\HasLocalization\\.$#" - count: 1 - path: app/Console/Commands/CheckIntl.php - - - - message: "#^Call to static method localizedString\\(\\) on an unknown class App\\\\Traits\\\\HasLocalization\\.$#" - count: 1 - path: app/Providers/GraphQLServiceProvider.php - - - - message: "#^PHPDoc tag @var has invalid type App\\\\Traits\\\\HasLocalization\\.$#" - count: 1 - path: app/Providers/GraphQLServiceProvider.php