Compare commits
2 Commits
267fe5cadd
...
10ad77d607
Author | SHA1 | Date | |
---|---|---|---|
10ad77d607 | |||
015f0c70b1 |
@ -85,7 +85,7 @@ class User {
|
|||||||
|
|
||||||
public function __toString() : string
|
public function __toString() : string
|
||||||
{
|
{
|
||||||
return $this->fullname();
|
return "{$this->firstName} {$this->lastName}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setPassword($password) : self
|
public function setPassword($password) : self
|
||||||
@ -95,9 +95,9 @@ class User {
|
|||||||
return $this->hashPassword();
|
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;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user