From 5181bbc60a2c72aa37344a260e39cd6f6211a803 Mon Sep 17 00:00:00 2001 From: bscheshirwork Date: Wed, 17 Oct 2018 10:04:16 +0300 Subject: [PATCH] separate Yii Event and namespace Event (#267) --- src/User/Bootstrap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/User/Bootstrap.php b/src/User/Bootstrap.php index a40200f..4ad380f 100644 --- a/src/User/Bootstrap.php +++ b/src/User/Bootstrap.php @@ -25,7 +25,7 @@ use yii\console\Application as ConsoleApplication; use yii\i18n\PhpMessageSource; use yii\web\Application as WebApplication; -use yii\base\Event; +use yii\base\Event as YiiEvent; use Da\User\Event\FormEvent; use Da\User\Controller\SecurityController; @@ -153,7 +153,7 @@ class Bootstrap implements BootstrapInterface // Attach an event to check if the password has expired if (!is_null(Yii::$app->getModule('user')->maxPasswordAge)) { - Event::on(SecurityController::class, FormEvent::EVENT_AFTER_LOGIN, function (FormEvent $event) { + YiiEvent::on(SecurityController::class, FormEvent::EVENT_AFTER_LOGIN, function (FormEvent $event) { $user = $event->form->user; if ($user->password_age >= Yii::$app->getModule('user')->maxPasswordAge) { // Force password change