Merge branch 'master' of https://git.mcnd.ca/mcndave/ulmus-user
This commit is contained in:
commit
4664a8779a
2 files changed
+9
-7
No files matched your search
+4
-4
@@ -57,7 +57,7 @@ class User {
|
||||
|
||||
public function __toString() : string
|
||||
{
|
||||
return $this->fullname();
|
||||
return "{$this->firstName} {$this->lastName}";
|
||||
}
|
||||
|
||||
public function setPassword($password) : self
|
||||
@@ -67,16 +67,16 @@ class User {
|
||||
return $this->hashPassword();
|
||||
}
|
||||
|
||||
public function hashPassword() : self
|
||||
public function hashPassword(? string $password = null) : self
|
||||
{
|
||||
$this->password = password_hash($this->password, PASSWORD_DEFAULT);
|
||||
$this->password = password_hash($password ?: $this->password, PASSWORD_DEFAULT);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function verifyPassword(string $password) : bool
|
||||
{
|
||||
return password_verify($password, $this->password );
|
||||
return password_verify($password, $this->password);
|
||||
}
|
||||
|
||||
public function fullname() : string
|
||||
|
||||
Reference in new issue
Block a user