<?php
namespace Whater\Domain\Security\ValueObject;
/**
* Class AuthUser
*
* @package Whater\Domain\Security\ValueObject
*/
final class AuthUser
{
/**
* @var string
*/
private $username;
/**
* @var string
*/
private $passwordHash;
public function __construct(string $username, EncodedPasswordInterface $encodedPassword)
{
$this->username = $username;
$this->passwordHash = (string) $encodedPassword;
}
public function username(): string
{
return $this->username;
}
public function password(): string
{
return $this->passwordHash;
}
public function removeAuth()
{
$this->username = $this->username . '@DELETE@' . time();
}
}