mirror of
https://github.com/elyby/accounts.git
synced 2026-10-20 20:58:03 +05:30
Cleanup code, improve typings
This commit is contained in:
1 parent
830a17612b
commit
d9ef27b745
28 files changed
+189
-225
No files matched your search
@@ -24,7 +24,7 @@ class EmailActivationKeyValidator extends Validator {
|
||||
|
||||
public $skipOnEmpty = false;
|
||||
|
||||
public function validateAttribute($model, $attribute) {
|
||||
public function validateAttribute($model, $attribute): void {
|
||||
$value = $model->$attribute;
|
||||
if (empty($value)) {
|
||||
$this->addError($model, $attribute, $this->keyRequired);
|
||||
@@ -49,7 +49,7 @@ class EmailActivationKeyValidator extends Validator {
|
||||
$query = EmailActivation::find();
|
||||
$query->andWhere(['key' => $key]);
|
||||
if ($type !== null) {
|
||||
$query->andWhere(['type' => $type]);
|
||||
$query->withType($type);
|
||||
}
|
||||
|
||||
return $query->one();
|
||||
|
||||
Reference in new issue
Block a user