The return types of some of the methods in Sentinel return bool or an object. As far as I can tell it's the only file in the code base that mixes return types like this. I think it would make sense to change the return types to null or an object. As from what I can tell most methods which return a bool or objects type dont truly return mixed types and instead only return false or an object. Rather than returning false I think returning null would be more sensible.
For example Sentinel::check only returns false or EloquentUser I think returning null makes more sense if a user is not logged in.
This way typehinting can be implemented on these methods and they would be more consistent with the rest of the project.
I understand this is a breaking change for user land I figured with the major revision happening this would be the best time to fix.
The return types of some of the methods in
Sentinel
return bool or an object. As far as I can tell it's the only file in the code base that mixes return types like this. I think it would make sense to change the return types to null or an object. As from what I can tell most methods which return a bool or objects type dont truly return mixed types and instead only return false or an object. Rather than returning false I think returning null would be more sensible.For example
Sentinel::check
only returns false orEloquentUser
I think returning null makes more sense if a user is not logged in.This way typehinting can be implemented on these methods and they would be more consistent with the rest of the project.
I understand this is a breaking change for user land I figured with the major revision happening this would be the best time to fix.