Implemented account deletion. Not all cases covered with tests [skip ci]

This commit is contained in:
ErickSkrauch
2020-06-12 00:27:02 +03:00
parent c86817a93d
commit 0183e54442
56 changed files with 1041 additions and 188 deletions

View File

@@ -7,26 +7,22 @@ use common\models\OauthClient;
use Yii;
use yii\queue\RetryableJobInterface;
class ClearOauthSessions implements RetryableJobInterface {
final class ClearOauthSessions implements RetryableJobInterface {
public string $clientId;
/**
* @var int
* @var int|null unix timestamp, that allows to limit this task to clear only some old sessions
*/
public $clientId;
public ?int $notSince;
/**
* @var int unix timestamp, that allows to limit this task to clear only some old sessions
*/
public $notSince;
public function __construct(string $clientId, int $notSince = null) {
$this->clientId = $clientId;
$this->notSince = $notSince;
}
public static function createFromOauthClient(OauthClient $client, int $notSince = null): self {
$result = new static();
$result->clientId = $client->id;
if ($notSince !== null) {
$result->notSince = $notSince;
}
return $result;
return new self($client->id, $notSince);
}
public function getTtr(): int {