Close #108 phpcs fixes

This commit is contained in:
Antonio Ramirez
2017-11-12 22:01:28 +01:00
parent 190fafa5f1
commit c418ad967c
14 changed files with 27 additions and 29 deletions

View File

@ -139,9 +139,8 @@ class AdminController extends Controller
Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'User has been created')); Yii::$app->getSession()->setFlash('success', Yii::t('usuario', 'User has been created'));
$this->trigger(UserEvent::EVENT_AFTER_CREATE, $event); $this->trigger(UserEvent::EVENT_AFTER_CREATE, $event);
return $this->redirect(['update', 'id' => $user->id]); 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]); return $this->render('create', ['user' => $user]);

View File

@ -121,9 +121,8 @@ class RegistrationController extends Controller
'module' => $this->module, '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]); return $this->render('register', ['model' => $form, 'module' => $this->module]);
} }

View File

@ -120,9 +120,9 @@ class MailFactory
* @param string $view * @param string $view
* @param array $params * @param array $params
* *
* @throws InvalidConfigException
* @return MailService * @return MailService
* *
* @throws InvalidConfigException
*/ */
public static function makeMailerService($type, $from, $to, $subject, $view, $params = []) public static function makeMailerService($type, $from, $to, $subject, $view, $params = [])
{ {

View File

@ -43,7 +43,6 @@ class AccessRuleFilter extends AccessRule
return true; return true;
} }
} else { } else {
$roleParams = $this->roleParams instanceof Closure $roleParams = $this->roleParams instanceof Closure
? call_user_func($this->roleParams, $this) ? call_user_func($this->roleParams, $this)
: $this->roleParams; : $this->roleParams;

View File

@ -60,10 +60,10 @@ class SettingsForm extends Model
} }
/** /**
* @return array
*
* @throws InvalidConfigException * @throws InvalidConfigException
* @throws \Exception * @throws \Exception
* @return array
*
*/ */
public function rules() public function rules()
{ {
@ -124,9 +124,9 @@ class SettingsForm extends Model
/** /**
* Saves new account settings. * Saves new account settings.
* *
* @throws \Exception
* @return bool * @return bool
* *
* @throws \Exception
*/ */
public function save() public function save()
{ {

View File

@ -18,9 +18,9 @@ class MigrationHelper
/** /**
* @param string $driverName * @param string $driverName
* *
* @throws RuntimeException
* @return null|string * @return null|string
* *
* @throws RuntimeException
*/ */
public static function resolveTableOptions($driverName) public static function resolveTableOptions($driverName)
{ {
@ -40,9 +40,9 @@ class MigrationHelper
/** /**
* @param $driverName * @param $driverName
* *
* @throws RuntimeException
* @return string * @return string
* *
* @throws RuntimeException
*/ */
public static function resolveDbType($driverName) public static function resolveDbType($driverName)
{ {
@ -63,9 +63,9 @@ class MigrationHelper
/** /**
* @param string $driverName * @param string $driverName
* *
* @throws RuntimeException
* @return bool * @return bool
* *
* @throws RuntimeException
*/ */
public static function isMicrosoftSQLServer($driverName) public static function isMicrosoftSQLServer($driverName)
{ {

View File

@ -32,9 +32,9 @@ class SecurityHelper
* @param string $password * @param string $password
* @param null|int $cost * @param null|int $cost
* *
* @throws Exception
* @return string * @return string
* *
* @throws Exception
*/ */
public function generatePasswordHash($password, $cost = null) public function generatePasswordHash($password, $cost = null)
{ {
@ -46,9 +46,9 @@ class SecurityHelper
* *
* @param int $length * @param int $length
* *
* @throws Exception
* @return string * @return string
* *
* @throws Exception
*/ */
public function generateRandomString($length = 32) public function generateRandomString($length = 32)
{ {

View File

@ -21,9 +21,9 @@ class TimezoneHelper
/** /**
* Get all of the time zones with the offsets sorted by their offset. * Get all of the time zones with the offsets sorted by their offset.
* *
* @throws InvalidParamException
* @return array * @return array
* *
* @throws InvalidParamException
*/ */
public static function getAll() public static function getAll()
{ {

View File

@ -279,9 +279,9 @@ class User extends ActiveRecord implements IdentityInterface
} }
/** /**
* @throws \Exception
* @return SocialNetworkAccount[] social connected accounts [ 'providerName' => socialAccountModel ] * @return SocialNetworkAccount[] social connected accounts [ 'providerName' => socialAccountModel ]
* *
* @throws \Exception
*/ */
public function getSocialNetworkAccounts() public function getSocialNetworkAccounts()
{ {

View File

@ -36,10 +36,10 @@ class UserCreateService implements ServiceInterface
} }
/** /**
* @return bool
*
* @throws InvalidCallException * @throws InvalidCallException
* @throws \yii\db\Exception * @throws \yii\db\Exception
* @return bool
*
*/ */
public function run() public function run()
{ {

View File

@ -19,8 +19,8 @@ use Da\User\Model\User;
use Da\User\Traits\MailAwareTrait; use Da\User\Traits\MailAwareTrait;
use Da\User\Traits\ModuleAwareTrait; use Da\User\Traits\ModuleAwareTrait;
use Exception; use Exception;
use yii\base\InvalidCallException;
use Yii; use Yii;
use yii\base\InvalidCallException;
class UserRegisterService implements ServiceInterface class UserRegisterService implements ServiceInterface
{ {

View File

@ -40,6 +40,7 @@ trait ContainerAwareTrait
* @param array $params constructor parameters * @param array $params constructor parameters
* @param array $config attributes * @param array $config attributes
* *
* @throws InvalidConfigException
* @return object * @return object
*/ */
public function make($class, $params = [], $config = []) public function make($class, $params = [], $config = [])
@ -48,9 +49,9 @@ trait ContainerAwareTrait
} }
/** /**
* @throws InvalidConfigException
* @return \Da\User\Helper\AuthHelper|object * @return \Da\User\Helper\AuthHelper|object
* *
* @throws InvalidConfigException
*/ */
public function getAuth() public function getAuth()
{ {
@ -58,9 +59,9 @@ trait ContainerAwareTrait
} }
/** /**
* @throws InvalidConfigException
* @return \Da\User\Helper\ClassMapHelper|object * @return \Da\User\Helper\ClassMapHelper|object
* *
* @throws InvalidConfigException
*/ */
public function getClassMap() public function getClassMap()
{ {

View File

@ -37,9 +37,9 @@ class TwoFactorCodeValidator implements ValidatorInterface
} }
/** /**
* @throws InvalidSecretKeyException
* @return bool|int * @return bool|int
* *
* @throws InvalidSecretKeyException
*/ */
public function validate() public function validate()
{ {