Conversation
This commit introduces a cast for the 'type' property in the Role model using the RoleType enum to enforce type safety. It also refactors the BaseRoleService to use the getType() method, improving clarity and reducing reliance on raw value matching. These changes ensure better maintainability and stricter type adherence.
Simplify the role type comparison by directly using the roleType object instead of its value property. This change ensures consistency and reduces unnecessary property access. Adjust the update method accordingly to reflect this modification.
Replaced the redundant variable assignment in the `getType` method with a direct return statement. This improves code readability and eliminates unnecessary lines without changing functionality.
Replaced the hardcoded `false` with a call to `isModerator`. This ensures the method correctly evaluates whether a user has moderation privileges.
Updated the `Role` model's docblock type hint for `$type` to reflect its usage as `RoleType`. This ensures consistency and clarity in type definitions within the codebase.
PR Summary
|
No description provided.