cartalyst / sentinel

A framework agnostic authentication & authorization system.
BSD 3-Clause "New" or "Revised" License
1.51k stars 238 forks source link

null can be returned when registering with a callback #507

Open 8633brown opened 4 years ago

8633brown commented 4 years ago

Your Environment

Expected behaviour

as per the docs Sentinel::register should return bool|UserInterface

Actual behaviour

https://github.com/cartalyst/sentinel/blob/c7420487cd82ef135ed384a75056674902b755bb/src/Users/IlluminateUserRepository.php#L188 IlluminateUserRepository::create returns null https://github.com/cartalyst/sentinel/blob/c7420487cd82ef135ed384a75056674902b755bb/src/Sentinel.php#L183-L191 which is then returned from `Sentinel::register'

suwardany commented 4 years ago

i guess it's just the docs outdated here

8633brown commented 4 years ago

yes and no? more the doc block return type.

suwardany commented 4 years ago

you're right ya

8633brown commented 4 years ago

would it not be better to return false if ::create returns null? but i suppose this is against semantic versioning?