- User now has a reverse fullname parameter
- forgetMe() defined as void
This commit is contained in:
parent
23079e6040
commit
33ff1b5b8c
@ -80,9 +80,13 @@ abstract class User implements UserInterface {
|
||||
return password_verify($password, $this->password ?? null);
|
||||
}
|
||||
|
||||
public function fullName() : string
|
||||
public function fullname(bool $reverse = false) : string
|
||||
{
|
||||
return trim( ( $this->firstName ?? "" ) . " " . ( $this->lastName ?? "" ) );
|
||||
if (! $this->isLoaded() ) {
|
||||
return "???";
|
||||
}
|
||||
|
||||
return trim($reverse ? "{$this->lastName}, {$this->firstName}" : "{$this->firstName} {$this->lastName}");
|
||||
}
|
||||
|
||||
public function loggedIn(?bool $set = null): bool
|
||||
|
||||
@ -37,7 +37,8 @@ class Authenticate {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function forgetMe() {
|
||||
public function forgetMe() : void
|
||||
{
|
||||
$this->cookie->delete("user.id");
|
||||
$this->session->destroy();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user