mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Implemented account deletion. Not all cases covered with tests [skip ci]
This commit is contained in:
@ -1,20 +1,18 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace api\validators;
|
||||
|
||||
use api\rbac\Permissions as P;
|
||||
use common\helpers\Error as E;
|
||||
use common\models\Account;
|
||||
use yii\base\InvalidConfigException;
|
||||
use yii\di\Instance;
|
||||
use yii\validators\Validator;
|
||||
use yii\web\User;
|
||||
|
||||
class PasswordRequiredValidator extends Validator {
|
||||
|
||||
/**
|
||||
* @var Account
|
||||
*/
|
||||
public $account;
|
||||
public Account $account;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
@ -28,10 +26,6 @@ class PasswordRequiredValidator extends Validator {
|
||||
|
||||
public function init() {
|
||||
parent::init();
|
||||
if (!$this->account instanceof Account) {
|
||||
throw new InvalidConfigException('account should be instance of ' . Account::class);
|
||||
}
|
||||
|
||||
$this->user = Instance::ensure($this->user, User::class);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user