Skip to content

Commit

Permalink
chore: Remove duplicate nullable check (cartalyst#498)
Browse files Browse the repository at this point in the history
* remove duplicate null check

* register default $callback value fixed
  • Loading branch information
8633brown authored and brunogaspar committed Sep 10, 2019
1 parent dd70547 commit 6fba896
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Sentinel.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ public function __construct(
*
* @return bool|\Cartalyst\Sentinel\Users\UserInterface
*/
public function register(array $credentials, $callback = null)
public function register(array $credentials, $callback = false)
{
if ($callback !== null && ! $callback instanceof Closure && ! is_bool($callback)) {
if (! $callback instanceof Closure && ! is_bool($callback)) {
throw new InvalidArgumentException('You must provide a closure or a boolean.');
}

Expand Down Expand Up @@ -309,7 +309,7 @@ public function authenticate($credentials, bool $remember = false, bool $login =

$valid = $user !== null ? $this->users->validateCredentials($user, $credentials) : false;

if ($user === null || ! $valid) {
if (! $valid) {
$this->cycleCheckpoints('fail', $user, false);

return false;
Expand Down

0 comments on commit 6fba896

Please sign in to comment.