diff --git a/CHANGELOG.md b/CHANGELOG.md index 782dd45..8ba2d8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,10 @@ ## 1.1.1 - Work in progress - Bug #106: Correct exception value returned in `MailEvent::getException` (kartik-v) -- Enh #99: Added German translation (jkmssoft) +- Enh #99: Added German translation (jkmssoft) - Enh #100: Added pt-BR translation (gugoan) +- Enh #105: Consolidate 2fa messages (maxxer) +- Fix #108: Use main logger app (tonydspaniard) ## 1.1.0 - October 22, 2017 - Enh #91: Documentation for Mail events (kartik-v) diff --git a/src/User/Bootstrap.php b/src/User/Bootstrap.php index 0f36307..7386ce2 100644 --- a/src/User/Bootstrap.php +++ b/src/User/Bootstrap.php @@ -20,6 +20,7 @@ use yii\authclient\Collection; use yii\base\Application; use yii\base\BootstrapInterface; use yii\base\Exception; +use yii\base\InvalidConfigException; use yii\console\Application as ConsoleApplication; use yii\i18n\PhpMessageSource; use yii\web\Application as WebApplication; @@ -161,6 +162,8 @@ class Bootstrap implements BootstrapInterface * Registers module translation messages. * * @param Application $app + * + * @throws InvalidConfigException */ protected function initTranslations(Application $app) { @@ -177,6 +180,8 @@ class Bootstrap implements BootstrapInterface * Ensures the auth manager is the one provided by the library. * * @param Application $app + * + * @throws InvalidConfigException */ protected function initAuthManager(Application $app) { @@ -194,6 +199,8 @@ class Bootstrap implements BootstrapInterface * Initializes web url routes (rules in Yii2). * * @param WebApplication $app + * + * @throws InvalidConfigException */ protected function initUrlRoutes(WebApplication $app) { @@ -236,6 +243,8 @@ class Bootstrap implements BootstrapInterface * Ensures the authCollection component is configured. * * @param WebApplication $app + * + * @throws InvalidConfigException */ protected function initAuthCollection(WebApplication $app) { diff --git a/src/User/Component/AuthDbManagerComponent.php b/src/User/Component/AuthDbManagerComponent.php index 7422e58..49f7686 100644 --- a/src/User/Component/AuthDbManagerComponent.php +++ b/src/User/Component/AuthDbManagerComponent.php @@ -68,7 +68,6 @@ class AuthDbManagerComponent extends DbManager implements AuthManagerInterface $roles = []; foreach ($query->all($this->db) as $row) { $roles[$row['name']] = $this->populateItem($row); - $roles[$row['name']] = $this->populateItem($row); } return $roles; diff --git a/src/User/Component/ReCaptchaComponent.php b/src/User/Component/ReCaptchaComponent.php index 31f57a5..62009a2 100644 --- a/src/User/Component/ReCaptchaComponent.php +++ b/src/User/Component/ReCaptchaComponent.php @@ -29,6 +29,8 @@ class ReCaptchaComponent extends Component /** * @inheritdoc + * + * @throws InvalidConfigException */ public function init() { diff --git a/src/User/Event/MailEvent.php b/src/User/Event/MailEvent.php index 89f6288..8ebe5f8 100644 --- a/src/User/Event/MailEvent.php +++ b/src/User/Event/MailEvent.php @@ -15,11 +15,6 @@ use Da\User\Model\User; use Da\User\Service\MailService; use yii\base\Event; -/** - * Mailer event to trap and handle mail exceptions for user model actions - * - * @author Kartik Visweswaran - */ class MailEvent extends Event { const TYPE_WELCOME = 'welcome'; diff --git a/src/User/Event/ProfileEvent.php b/src/User/Event/ProfileEvent.php index 7a19f29..902c276 100644 --- a/src/User/Event/ProfileEvent.php +++ b/src/User/Event/ProfileEvent.php @@ -22,7 +22,7 @@ class ProfileEvent extends Event { $this->profile = $profile; - return parent::__construct($config); + parent::__construct($config); } public function getProfile() diff --git a/src/User/Factory/MailFactory.php b/src/User/Factory/MailFactory.php index aea6550..f8a4733 100644 --- a/src/User/Factory/MailFactory.php +++ b/src/User/Factory/MailFactory.php @@ -17,13 +17,8 @@ use Da\User\Model\User; use Da\User\Module; use Da\User\Service\MailService; use Yii; +use yii\base\InvalidConfigException; -/** - * Class MailFactory - * - * @package Da\User\Factory - * @modified 2017-10-18 by Kartik Visweswaran - */ class MailFactory { /** @@ -126,6 +121,8 @@ class MailFactory * @param array $params * * @return MailService + * + * @throws InvalidConfigException */ public static function makeMailerService($type, $from, $to, $subject, $view, $params = []) { diff --git a/src/User/Form/LoginForm.php b/src/User/Form/LoginForm.php index c708a85..9d8ae25 100644 --- a/src/User/Form/LoginForm.php +++ b/src/User/Form/LoginForm.php @@ -11,6 +11,7 @@ namespace Da\User\Form; +use Da\TwoFA\Exception\InvalidSecretKeyException; use Da\User\Helper\SecurityHelper; use Da\User\Model\User; use Da\User\Query\UserQuery; @@ -79,6 +80,8 @@ class LoginForm extends Model /** * {@inheritdoc} + * + * @throws InvalidSecretKeyException */ public function rules() { diff --git a/src/User/Form/RegistrationForm.php b/src/User/Form/RegistrationForm.php index e45bbeb..09e0af2 100644 --- a/src/User/Form/RegistrationForm.php +++ b/src/User/Form/RegistrationForm.php @@ -37,6 +37,8 @@ class RegistrationForm extends Model /** * {@inheritdoc} + * + * @throws \Exception */ public function rules() { diff --git a/src/User/Form/SettingsForm.php b/src/User/Form/SettingsForm.php index 25a9b3d..a49108e 100644 --- a/src/User/Form/SettingsForm.php +++ b/src/User/Form/SettingsForm.php @@ -17,6 +17,7 @@ use Da\User\Model\User; use Da\User\Traits\ContainerAwareTrait; use Da\User\Traits\ModuleAwareTrait; use Yii; +use yii\base\InvalidConfigException; use yii\base\Model; class SettingsForm extends Model @@ -60,6 +61,9 @@ class SettingsForm extends Model /** * @return array + * + * @throws InvalidConfigException + * @throws \Exception */ public function rules() { @@ -75,7 +79,7 @@ class SettingsForm extends Model ['email', 'username'], 'unique', 'when' => function ($model, $attribute) { - return $this->getUser()->$attribute != $model->$attribute; + return $this->getUser()->$attribute !== $model->$attribute; }, 'targetClass' => $this->getClassMap()->get(User::class), ], @@ -110,7 +114,7 @@ class SettingsForm extends Model */ public function getUser() { - if ($this->user == null) { + if (null === $this->user) { $this->user = Yii::$app->user->identity; } @@ -121,6 +125,8 @@ class SettingsForm extends Model * Saves new account settings. * * @return bool + * + * @throws \Exception */ public function save() { @@ -130,9 +136,9 @@ class SettingsForm extends Model $user->scenario = 'settings'; $user->username = $this->username; $user->password = $this->new_password; - if ($this->email == $user->email && $user->unconfirmed_email != null) { + if ($this->email === $user->email && $user->unconfirmed_email !== null) { $user->unconfirmed_email = null; - } elseif ($this->email != $user->email) { + } elseif ($this->email !== $user->email) { $strategy = EmailChangeStrategyFactory::makeByStrategyType( $this->getModule()->emailChangeStrategy, $this diff --git a/src/User/Helper/AuthHelper.php b/src/User/Helper/AuthHelper.php index 651e560..e85e191 100644 --- a/src/User/Helper/AuthHelper.php +++ b/src/User/Helper/AuthHelper.php @@ -56,7 +56,7 @@ class AuthHelper ? Yii::$app->getUser()->can($module->administratorPermissionName) : false; - return $hasAdministratorPermissionName || in_array($username, $module->administrators); + return $hasAdministratorPermissionName || in_array($username, $module->administrators, false); } /** @@ -99,7 +99,7 @@ class AuthHelper public function getUnassignedItems(AbstractAuthItem $model) { $excludeItems = $model->item !== null ? [$model->item->name] : []; - $type = $model->getType() == Permission::TYPE_PERMISSION ? Permission::TYPE_PERMISSION : null; + $type = $model->getType() === Permission::TYPE_PERMISSION ? Permission::TYPE_PERMISSION : null; $items = $this->getAuthManager()->getItems($type, $excludeItems); return ArrayHelper::map( diff --git a/src/User/Helper/ClassMapHelper.php b/src/User/Helper/ClassMapHelper.php index fac9a3d..cd9c6d7 100644 --- a/src/User/Helper/ClassMapHelper.php +++ b/src/User/Helper/ClassMapHelper.php @@ -11,14 +11,6 @@ namespace Da\User\Helper; -/** - * ModelMapHelper.php. - * - * Date: 3/12/16 - * Time: 18:10 - * - * @author Antonio Ramirez - */ class ClassMapHelper { protected $map = []; diff --git a/src/User/Helper/MigrationHelper.php b/src/User/Helper/MigrationHelper.php index ed30648..38a37eb 100644 --- a/src/User/Helper/MigrationHelper.php +++ b/src/User/Helper/MigrationHelper.php @@ -19,6 +19,8 @@ class MigrationHelper * @param string $driverName * * @return null|string + * + * @throws RuntimeException */ public static function resolveTableOptions($driverName) { @@ -39,6 +41,8 @@ class MigrationHelper * @param $driverName * * @return string + * + * @throws RuntimeException */ public static function resolveDbType($driverName) { @@ -60,9 +64,11 @@ class MigrationHelper * @param string $driverName * * @return bool + * + * @throws RuntimeException */ public static function isMicrosoftSQLServer($driverName) { - return self::resolveDbType($driverName) == 'sqlsrv'; + return self::resolveDbType($driverName) === 'sqlsrv'; } } diff --git a/src/User/Helper/SecurityHelper.php b/src/User/Helper/SecurityHelper.php index babff35..c68163e 100644 --- a/src/User/Helper/SecurityHelper.php +++ b/src/User/Helper/SecurityHelper.php @@ -11,6 +11,7 @@ namespace Da\User\Helper; +use yii\base\Exception; use yii\base\Security; class SecurityHelper @@ -32,12 +33,23 @@ class SecurityHelper * @param null|int $cost * * @return string + * + * @throws Exception */ public function generatePasswordHash($password, $cost = null) { return $this->security->generatePasswordHash($password, $cost); } + /** + * Generates a random string + * + * @param int $length + * + * @return string + * + * @throws Exception + */ public function generateRandomString($length = 32) { return $this->security->generateRandomString($length); diff --git a/src/User/Helper/TimezoneHelper.php b/src/User/Helper/TimezoneHelper.php index 581b48f..636b8d2 100644 --- a/src/User/Helper/TimezoneHelper.php +++ b/src/User/Helper/TimezoneHelper.php @@ -13,6 +13,7 @@ namespace Da\User\Helper; use DateTime; use DateTimeZone; +use yii\base\InvalidParamException; use yii\helpers\ArrayHelper; class TimezoneHelper @@ -21,6 +22,8 @@ class TimezoneHelper * Get all of the time zones with the offsets sorted by their offset. * * @return array + * + * @throws InvalidParamException */ public static function getAll() { diff --git a/src/User/Model/Profile.php b/src/User/Model/Profile.php index 450c878..1991b0a 100644 --- a/src/User/Model/Profile.php +++ b/src/User/Model/Profile.php @@ -20,6 +20,7 @@ use DateTime; use DateTimeZone; use Exception; use Yii; +use yii\base\InvalidParamException; use yii\db\ActiveRecord; /** @@ -41,6 +42,8 @@ class Profile extends ActiveRecord /** * {@inheritdoc} + * + * @throws InvalidParamException */ public function beforeSave($insert) { diff --git a/src/User/Model/User.php b/src/User/Model/User.php index 7fc3771..3ef8adb 100644 --- a/src/User/Model/User.php +++ b/src/User/Model/User.php @@ -16,6 +16,7 @@ use Da\User\Query\UserQuery; use Da\User\Traits\ContainerAwareTrait; use Da\User\Traits\ModuleAwareTrait; use Yii; +use yii\base\InvalidParamException; use yii\base\NotSupportedException; use yii\behaviors\TimestampBehavior; use yii\db\ActiveRecord; @@ -71,6 +72,8 @@ class User extends ActiveRecord implements IdentityInterface /** * {@inheritdoc} + * + * @throws InvalidParamException */ public function beforeSave($insert) { @@ -277,6 +280,8 @@ class User extends ActiveRecord implements IdentityInterface /** * @return SocialNetworkAccount[] social connected accounts [ 'providerName' => socialAccountModel ] + * + * @throws \Exception */ public function getSocialNetworkAccounts() { @@ -307,6 +312,8 @@ class User extends ActiveRecord implements IdentityInterface /** * {@inheritdoc} + * + * @throws NotSupportedException */ public static function findIdentityByAccessToken($token, $type = null) { diff --git a/src/User/Service/AuthRuleEditionService.php b/src/User/Service/AuthRuleEditionService.php index 8ff4254..55983d7 100644 --- a/src/User/Service/AuthRuleEditionService.php +++ b/src/User/Service/AuthRuleEditionService.php @@ -31,14 +31,14 @@ class AuthRuleEditionService implements ServiceInterface public function run() { - if (!$this->model->validate() || (!in_array($this->model->scenario, ['create', 'update']))) { + if (!$this->model->validate() || (!in_array($this->model->scenario, ['create', 'update'], false))) { return false; } $rule = $this->make($this->model->className, [], ['name' => $this->model->name]); try { - if ($this->model->scenario == 'create') { + if ($this->model->scenario === 'create') { $this->getAuthManager()->add($rule); } else { $this->getAuthManager()->update($this->model->previousName, $rule); diff --git a/src/User/Service/EmailChangeService.php b/src/User/Service/EmailChangeService.php index 88d568c..3400846 100644 --- a/src/User/Service/EmailChangeService.php +++ b/src/User/Service/EmailChangeService.php @@ -76,8 +76,8 @@ class EmailChangeService implements ServiceInterface ); } } - if ($this->getModule()->emailChangeStrategy === MailChangeStrategyInterface::TYPE_DEFAULT - || ($this->model->flags & User::NEW_EMAIL_CONFIRMED & $this->model->flags & User::OLD_EMAIL_CONFIRMED) + if (($this->model->flags & User::NEW_EMAIL_CONFIRMED & $this->model->flags & User::OLD_EMAIL_CONFIRMED) + || $this->getModule()->emailChangeStrategy === MailChangeStrategyInterface::TYPE_DEFAULT ) { $this->model->email = $this->model->unconfirmed_email; $this->model->unconfirmed_email = null; diff --git a/src/User/Service/PasswordRecoveryService.php b/src/User/Service/PasswordRecoveryService.php index 08e7239..265d9ce 100644 --- a/src/User/Service/PasswordRecoveryService.php +++ b/src/User/Service/PasswordRecoveryService.php @@ -13,13 +13,11 @@ namespace Da\User\Service; use Da\User\Contracts\ServiceInterface; use Da\User\Factory\TokenFactory; -use Da\User\Model\Token; use Da\User\Model\User; use Da\User\Query\UserQuery; use Da\User\Traits\MailAwareTrait; use Exception; use Yii; -use yii\log\Logger; class PasswordRecoveryService implements ServiceInterface { @@ -30,14 +28,12 @@ class PasswordRecoveryService implements ServiceInterface protected $email; protected $mailService; protected $securityHelper; - protected $logger; - public function __construct($email, MailService $mailService, UserQuery $query, Logger $logger) + public function __construct($email, MailService $mailService, UserQuery $query) { $this->email = $email; $this->mailService = $mailService; $this->query = $query; - $this->logger = $logger; } public function run() @@ -65,7 +61,7 @@ class PasswordRecoveryService implements ServiceInterface return true; } catch (Exception $e) { - $this->logger->log($e->getMessage(), Logger::LEVEL_ERROR); + Yii::error($e->getMessage(), 'usuario'); return false; } diff --git a/src/User/Service/ResendConfirmationService.php b/src/User/Service/ResendConfirmationService.php index e70618a..7c131d9 100644 --- a/src/User/Service/ResendConfirmationService.php +++ b/src/User/Service/ResendConfirmationService.php @@ -15,7 +15,6 @@ use Da\User\Contracts\ServiceInterface; use Da\User\Factory\TokenFactory; use Da\User\Model\User; use Da\User\Traits\MailAwareTrait; -use yii\log\Logger; class ResendConfirmationService implements ServiceInterface { @@ -23,13 +22,11 @@ class ResendConfirmationService implements ServiceInterface protected $model; protected $mailService; - protected $logger; - public function __construct(User $model, MailService $mailService, Logger $logger) + public function __construct(User $model, MailService $mailService) { $this->model = $model; $this->mailService = $mailService; - $this->logger = $logger; } public function run() @@ -37,6 +34,7 @@ class ResendConfirmationService implements ServiceInterface if ($this->model && !$this->model->getIsConfirmed()) { $token = TokenFactory::makeConfirmationToken($this->model->id); $this->mailService->setViewParam('token', $token); + return $this->sendMail($this->model); } diff --git a/src/User/Service/TwoFactorQrCodeUriGeneratorService.php b/src/User/Service/TwoFactorQrCodeUriGeneratorService.php index e407b66..0492bdc 100644 --- a/src/User/Service/TwoFactorQrCodeUriGeneratorService.php +++ b/src/User/Service/TwoFactorQrCodeUriGeneratorService.php @@ -47,8 +47,7 @@ class TwoFactorQrCodeUriGeneratorService implements ServiceInterface } $totpUri = (new TOTPSecretKeyUriGeneratorService(Yii::$app->name, $user->email, $user->auth_tf_key))->run(); - $dataUri = (new QrCodeDataUriGeneratorService($totpUri))->run(); - return $dataUri; + return (new QrCodeDataUriGeneratorService($totpUri))->run(); } } diff --git a/src/User/Service/UserCreateService.php b/src/User/Service/UserCreateService.php index 9769362..5792172 100644 --- a/src/User/Service/UserCreateService.php +++ b/src/User/Service/UserCreateService.php @@ -19,7 +19,6 @@ use Da\User\Traits\MailAwareTrait; use Exception; use Yii; use yii\base\InvalidCallException; -use yii\log\Logger; class UserCreateService implements ServiceInterface { @@ -28,18 +27,19 @@ class UserCreateService implements ServiceInterface protected $model; protected $securityHelper; protected $mailService; - protected $logger; - public function __construct(User $model, MailService $mailService, SecurityHelper $securityHelper, Logger $logger) + public function __construct(User $model, MailService $mailService, SecurityHelper $securityHelper) { $this->model = $model; $this->mailService = $mailService; $this->securityHelper = $securityHelper; - $this->logger = $logger; } /** * @return bool + * + * @throws InvalidCallException + * @throws \yii\db\Exception */ public function run() { @@ -49,7 +49,7 @@ class UserCreateService implements ServiceInterface throw new InvalidCallException('Cannot create a new user from an existing one.'); } - $transaction = $model->getDb()->beginTransaction(); + $transaction = $model::getDb()->beginTransaction(); try { $model->confirmed_at = time(); @@ -81,7 +81,7 @@ class UserCreateService implements ServiceInterface return true; } catch (Exception $e) { $transaction->rollBack(); - $this->logger->log($e->getMessage(), Logger::LEVEL_ERROR); + Yii::error($e->getMessage(), 'usuario'); return false; } diff --git a/src/User/Service/UserRegisterService.php b/src/User/Service/UserRegisterService.php index b14d4a2..79be83c 100644 --- a/src/User/Service/UserRegisterService.php +++ b/src/User/Service/UserRegisterService.php @@ -20,7 +20,6 @@ use Da\User\Traits\MailAwareTrait; use Da\User\Traits\ModuleAwareTrait; use Exception; use yii\base\InvalidCallException; -use yii\log\Logger; use Yii; class UserRegisterService implements ServiceInterface @@ -31,14 +30,12 @@ class UserRegisterService implements ServiceInterface protected $model; protected $securityHelper; protected $mailService; - protected $logger; - public function __construct(User $model, MailService $mailService, SecurityHelper $securityHelper, Logger $logger) + public function __construct(User $model, MailService $mailService, SecurityHelper $securityHelper) { $this->model = $model; $this->mailService = $mailService; $this->securityHelper = $securityHelper; - $this->logger = $logger; } public function run() @@ -49,7 +46,7 @@ class UserRegisterService implements ServiceInterface throw new InvalidCallException('Cannot register user from an existing one.'); } - $transaction = $model->getDb()->beginTransaction(); + $transaction = $model::getDb()->beginTransaction(); try { $model->confirmed_at = $this->getModule()->enableEmailConfirmation ? null : time(); @@ -91,7 +88,7 @@ class UserRegisterService implements ServiceInterface return true; } catch (Exception $e) { $transaction->rollBack(); - $this->logger->log($e->getMessage(), Logger::LEVEL_ERROR); + Yii::error($e->getMessage(), 'usuario'); return false; } diff --git a/src/User/Traits/ContainerAwareTrait.php b/src/User/Traits/ContainerAwareTrait.php index 8bac337..e44ebae 100644 --- a/src/User/Traits/ContainerAwareTrait.php +++ b/src/User/Traits/ContainerAwareTrait.php @@ -14,6 +14,7 @@ namespace Da\User\Traits; use Da\User\Helper\AuthHelper; use Da\User\Helper\ClassMapHelper; use Yii; +use yii\base\InvalidConfigException; use yii\di\Container; /** @@ -48,6 +49,8 @@ trait ContainerAwareTrait /** * @return \Da\User\Helper\AuthHelper|object + * + * @throws InvalidConfigException */ public function getAuth() { @@ -56,6 +59,8 @@ trait ContainerAwareTrait /** * @return \Da\User\Helper\ClassMapHelper|object + * + * @throws InvalidConfigException */ public function getClassMap() { diff --git a/src/User/Traits/MailAwareTrait.php b/src/User/Traits/MailAwareTrait.php index 38d3693..d927d2c 100644 --- a/src/User/Traits/MailAwareTrait.php +++ b/src/User/Traits/MailAwareTrait.php @@ -15,12 +15,10 @@ use Da\User\Event\MailEvent; use Da\User\Model\User; use Da\User\Service\MailService; use Exception; -use yii\log\Logger; +use Yii; /** * @property MailService $mailService - * @property Logger $logger - * @author Kartik Visweswaran */ trait MailAwareTrait { @@ -42,7 +40,7 @@ trait MailAwareTrait $this->mailService->run(); } catch (Exception $e) { $event = $this->make(MailEvent::class, [$type, $user, $this->mailService, $e]); - $this->logger->log($e->getMessage(), Logger::LEVEL_ERROR); + Yii::error($e->getMessage(), 'usuario'); $user->trigger(MailEvent::EVENT_AFTER_SEND_MAIL, $event); return false; } diff --git a/src/User/Validator/RbacItemsValidator.php b/src/User/Validator/RbacItemsValidator.php index 60261ca..45d06c2 100644 --- a/src/User/Validator/RbacItemsValidator.php +++ b/src/User/Validator/RbacItemsValidator.php @@ -26,7 +26,7 @@ class RbacItemsValidator extends Validator } foreach ($value as $item) { - if ($this->getAuthManager()->getItem($item) == null) { + if ($this->getAuthManager()->getItem($item) === null) { return [Yii::t('usuario', 'There is neither role nor permission with name "{0}"', [$item]), []]; } } diff --git a/src/User/Validator/RbacRuleNameValidator.php b/src/User/Validator/RbacRuleNameValidator.php index 0089f82..edb5f9f 100644 --- a/src/User/Validator/RbacRuleNameValidator.php +++ b/src/User/Validator/RbacRuleNameValidator.php @@ -30,7 +30,7 @@ class RbacRuleNameValidator extends Validator */ protected function validateValue($value) { - if ($this->previousName != $value) { + if ($this->previousName !== $value) { $rule = $this->getAuthManager()->getRule($value); if ($rule instanceof Rule) { diff --git a/src/User/Validator/TwoFactorCodeValidator.php b/src/User/Validator/TwoFactorCodeValidator.php index fe9822d..48b330c 100644 --- a/src/User/Validator/TwoFactorCodeValidator.php +++ b/src/User/Validator/TwoFactorCodeValidator.php @@ -11,6 +11,7 @@ namespace Da\User\Validator; +use Da\TwoFA\Exception\InvalidSecretKeyException; use Da\TwoFA\Manager; use Da\User\Contracts\ValidatorInterface; use Da\User\Model\User; @@ -37,6 +38,8 @@ class TwoFactorCodeValidator implements ValidatorInterface /** * @return bool|int + * + * @throws InvalidSecretKeyException */ public function validate() { diff --git a/src/User/Widget/AssignmentsWidget.php b/src/User/Widget/AssignmentsWidget.php index 646ae81..4b76dd7 100644 --- a/src/User/Widget/AssignmentsWidget.php +++ b/src/User/Widget/AssignmentsWidget.php @@ -16,6 +16,7 @@ use Da\User\Service\UpdateAuthAssignmentsService; use Da\User\Traits\AuthManagerAwareTrait; use Da\User\Traits\ContainerAwareTrait; use yii\base\InvalidConfigException; +use yii\base\InvalidParamException; use yii\base\Widget; use yii\helpers\ArrayHelper; @@ -48,6 +49,8 @@ class AssignmentsWidget extends Widget /** * {@inheritdoc} + * + * @throws InvalidParamException */ public function run() {