entrust
entrust copied to clipboard
Update EntrustUserTrait.php
Summary of Improvements
- Introduced proper type hinting for parameters and return values
- Refactored complex logic into smaller, reusable helper methods
- Used
??for cleaner default handling - Replaced verbose conditionals with
matchexpression - Enforced strict comparison (
===) for better reliability - Improved naming (e.g.
boot→bootEntrustUserTrait) to prevent conflicts - Simplified repeated access/role logic
- Removed redundant
returnstatements from void methods
These changes improve readability, maintainability, and type safety without altering the original behavior.