Compare commits

...

3 Commits

3 changed files with 9 additions and 4 deletions

View File

@ -10,7 +10,7 @@
} }
], ],
"require": { "require": {
"mcnd/ulmus": "dev-master" "mcnd/ulmus": "^1.0 || ^2.0"
}, },
"repositories": [ "repositories": [
{ {

View File

@ -80,9 +80,13 @@ abstract class User implements UserInterface {
return password_verify($password, $this->password ?? null); 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 public function loggedIn(?bool $set = null): bool

View File

@ -37,7 +37,8 @@ class Authenticate {
return null; return null;
} }
public function forgetMe() { public function forgetMe() : void
{
$this->cookie->delete("user.id"); $this->cookie->delete("user.id");
$this->session->destroy(); $this->session->destroy();
} }