Cleanup code, improve typings

This commit is contained in:
ErickSkrauch
2019-12-13 22:27:13 +03:00
parent 830a17612b
commit d9ef27b745
28 changed files with 189 additions and 225 deletions

View File

@@ -1,12 +1,19 @@
<?php
declare(strict_types=1);
namespace common\models\confirmations;
use common\models\EmailActivation;
use common\models\EmailActivationQuery;
use yii\helpers\ArrayHelper;
class ForgotPassword extends EmailActivation {
public function behaviors() {
public static function find(): EmailActivationQuery {
return parent::find()->withType(EmailActivation::TYPE_FORGOT_PASSWORD_KEY);
}
public function behaviors(): array {
return ArrayHelper::merge(parent::behaviors(), [
'expirationBehavior' => [
'repeatTimeout' => 30 * 60,
@@ -15,7 +22,7 @@ class ForgotPassword extends EmailActivation {
]);
}
public function init() {
public function init(): void {
parent::init();
$this->type = EmailActivation::TYPE_FORGOT_PASSWORD_KEY;
}