cartalyst / sentinel

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

Invalid if statement Sentinel::getRequestCredentials #494

Closed 8633brown closed 5 years ago

8633brown commented 5 years ago

https://github.com/cartalyst/sentinel/blob/cb9a3703386bd45d23bbd5f10ee036b9f91c26cf/src/Sentinel.php#L390-L399

This will never evaluate as true as getRequestCrdentials is now only typehinted to return an array. should the comparison now be looking for an empty array?

brunogaspar commented 5 years ago

should the comparison now be looking for an empty array?

This or make the method to allow array or null to be returned, ?array.

Though if the empty comparison works, probably that's the cleaner approach.

8633brown commented 5 years ago

just had a quick check. the getRequestCredentials can return null as far as i can tell. it creates the credentials variable line 419 but doesnt always return it. https://github.com/cartalyst/sentinel/blob/cb9a3703386bd45d23bbd5f10ee036b9f91c26cf/src/Sentinel.php#L415-L438