diff --git a/src/User/Controller/AdminController.php b/src/User/Controller/AdminController.php index f0ddf23..63ded04 100644 --- a/src/User/Controller/AdminController.php +++ b/src/User/Controller/AdminController.php @@ -139,9 +139,8 @@ class AdminController extends Controller Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'User has been created')); $this->trigger(UserEvent::EVENT_AFTER_CREATE, $event); return $this->redirect(['update', 'id' => $user->id]); - } else { - Yii::$app->session->setFlash('danger', Yii::t('usuario', 'User account could not be created.')); } + Yii::$app->session->setFlash('danger', Yii::t('usuario', 'User account could not be created.')); } return $this->render('create', ['user' => $user]); diff --git a/src/User/Controller/RegistrationController.php b/src/User/Controller/RegistrationController.php index 595db3d..f668387 100644 --- a/src/User/Controller/RegistrationController.php +++ b/src/User/Controller/RegistrationController.php @@ -121,9 +121,8 @@ class RegistrationController extends Controller 'module' => $this->module, ] ); - } else { - Yii::$app->session->setFlash('danger', Yii::t('usuario', 'User could not be registered.')); } + Yii::$app->session->setFlash('danger', Yii::t('usuario', 'User could not be registered.')); } return $this->render('register', ['model' => $form, 'module' => $this->module]); } diff --git a/src/User/Factory/MailFactory.php b/src/User/Factory/MailFactory.php index f8a4733..8de1c53 100644 --- a/src/User/Factory/MailFactory.php +++ b/src/User/Factory/MailFactory.php @@ -120,9 +120,9 @@ class MailFactory * @param string $view * @param array $params * + * @throws InvalidConfigException * @return MailService * - * @throws InvalidConfigException */ public static function makeMailerService($type, $from, $to, $subject, $view, $params = []) { diff --git a/src/User/Filter/AccessRuleFilter.php b/src/User/Filter/AccessRuleFilter.php index c837344..3f1c492 100644 --- a/src/User/Filter/AccessRuleFilter.php +++ b/src/User/Filter/AccessRuleFilter.php @@ -43,7 +43,6 @@ class AccessRuleFilter extends AccessRule return true; } } else { - $roleParams = $this->roleParams instanceof Closure ? call_user_func($this->roleParams, $this) : $this->roleParams; diff --git a/src/User/Form/SettingsForm.php b/src/User/Form/SettingsForm.php index a49108e..e3aabe4 100644 --- a/src/User/Form/SettingsForm.php +++ b/src/User/Form/SettingsForm.php @@ -60,10 +60,10 @@ class SettingsForm extends Model } /** - * @return array - * * @throws InvalidConfigException * @throws \Exception + * @return array + * */ public function rules() { @@ -124,9 +124,9 @@ class SettingsForm extends Model /** * Saves new account settings. * + * @throws \Exception * @return bool * - * @throws \Exception */ public function save() { diff --git a/src/User/Helper/MigrationHelper.php b/src/User/Helper/MigrationHelper.php index 38a37eb..7de2c41 100644 --- a/src/User/Helper/MigrationHelper.php +++ b/src/User/Helper/MigrationHelper.php @@ -18,9 +18,9 @@ class MigrationHelper /** * @param string $driverName * + * @throws RuntimeException * @return null|string * - * @throws RuntimeException */ public static function resolveTableOptions($driverName) { @@ -40,9 +40,9 @@ class MigrationHelper /** * @param $driverName * + * @throws RuntimeException * @return string * - * @throws RuntimeException */ public static function resolveDbType($driverName) { @@ -63,9 +63,9 @@ class MigrationHelper /** * @param string $driverName * + * @throws RuntimeException * @return bool * - * @throws RuntimeException */ public static function isMicrosoftSQLServer($driverName) { diff --git a/src/User/Helper/SecurityHelper.php b/src/User/Helper/SecurityHelper.php index c68163e..f540f0d 100644 --- a/src/User/Helper/SecurityHelper.php +++ b/src/User/Helper/SecurityHelper.php @@ -32,9 +32,9 @@ class SecurityHelper * @param string $password * @param null|int $cost * + * @throws Exception * @return string * - * @throws Exception */ public function generatePasswordHash($password, $cost = null) { @@ -46,9 +46,9 @@ class SecurityHelper * * @param int $length * + * @throws Exception * @return string * - * @throws Exception */ public function generateRandomString($length = 32) { diff --git a/src/User/Helper/TimezoneHelper.php b/src/User/Helper/TimezoneHelper.php index 636b8d2..aba5f17 100644 --- a/src/User/Helper/TimezoneHelper.php +++ b/src/User/Helper/TimezoneHelper.php @@ -21,9 +21,9 @@ class TimezoneHelper /** * Get all of the time zones with the offsets sorted by their offset. * + * @throws InvalidParamException * @return array * - * @throws InvalidParamException */ public static function getAll() { diff --git a/src/User/Model/User.php b/src/User/Model/User.php index 3ef8adb..1cc301b 100644 --- a/src/User/Model/User.php +++ b/src/User/Model/User.php @@ -279,9 +279,9 @@ class User extends ActiveRecord implements IdentityInterface } /** + * @throws \Exception * @return SocialNetworkAccount[] social connected accounts [ 'providerName' => socialAccountModel ] * - * @throws \Exception */ public function getSocialNetworkAccounts() { diff --git a/src/User/Service/MailService.php b/src/User/Service/MailService.php index 81e9b9c..a0dfd0d 100644 --- a/src/User/Service/MailService.php +++ b/src/User/Service/MailService.php @@ -31,13 +31,13 @@ class MailService implements ServiceInterface /** * MailService constructor. * - * @param string $type the mailer type - * @param string $from from email account - * @param string $to to email account - * @param string $subject the email subject - * @param string $view the view to render mail - * @param array $params view parameters - * @param BaseMailer|MailerInterface $mailer mailer interface + * @param string $type the mailer type + * @param string $from from email account + * @param string $to to email account + * @param string $subject the email subject + * @param string $view the view to render mail + * @param array $params view parameters + * @param BaseMailer|MailerInterface $mailer mailer interface */ public function __construct($type, $from, $to, $subject, $view, array $params, MailerInterface $mailer) { diff --git a/src/User/Service/UserCreateService.php b/src/User/Service/UserCreateService.php index 5792172..2463ef2 100644 --- a/src/User/Service/UserCreateService.php +++ b/src/User/Service/UserCreateService.php @@ -36,10 +36,10 @@ class UserCreateService implements ServiceInterface } /** - * @return bool - * * @throws InvalidCallException * @throws \yii\db\Exception + * @return bool + * */ public function run() { diff --git a/src/User/Service/UserRegisterService.php b/src/User/Service/UserRegisterService.php index 79be83c..eb15983 100644 --- a/src/User/Service/UserRegisterService.php +++ b/src/User/Service/UserRegisterService.php @@ -19,8 +19,8 @@ use Da\User\Model\User; use Da\User\Traits\MailAwareTrait; use Da\User\Traits\ModuleAwareTrait; use Exception; -use yii\base\InvalidCallException; use Yii; +use yii\base\InvalidCallException; class UserRegisterService implements ServiceInterface { diff --git a/src/User/Traits/ContainerAwareTrait.php b/src/User/Traits/ContainerAwareTrait.php index e44ebae..67baa3f 100644 --- a/src/User/Traits/ContainerAwareTrait.php +++ b/src/User/Traits/ContainerAwareTrait.php @@ -40,6 +40,7 @@ trait ContainerAwareTrait * @param array $params constructor parameters * @param array $config attributes * + * @throws InvalidConfigException * @return object */ public function make($class, $params = [], $config = []) @@ -48,9 +49,9 @@ trait ContainerAwareTrait } /** + * @throws InvalidConfigException * @return \Da\User\Helper\AuthHelper|object * - * @throws InvalidConfigException */ public function getAuth() { @@ -58,9 +59,9 @@ trait ContainerAwareTrait } /** + * @throws InvalidConfigException * @return \Da\User\Helper\ClassMapHelper|object * - * @throws InvalidConfigException */ public function getClassMap() { diff --git a/src/User/Validator/TwoFactorCodeValidator.php b/src/User/Validator/TwoFactorCodeValidator.php index 48b330c..9308390 100644 --- a/src/User/Validator/TwoFactorCodeValidator.php +++ b/src/User/Validator/TwoFactorCodeValidator.php @@ -37,9 +37,9 @@ class TwoFactorCodeValidator implements ValidatorInterface } /** + * @throws InvalidSecretKeyException * @return bool|int * - * @throws InvalidSecretKeyException */ public function validate() {