Update PHP-CS-Fixer to v3.x (#460)
This commit is contained in:
@ -365,7 +365,7 @@ class Bootstrap implements BootstrapInterface
|
||||
$mapping = array_merge($defaults, $userClassMap);
|
||||
|
||||
foreach ($mapping as $name => $definition) {
|
||||
$map[$this->getRoute($routes, $name) . "\\$name"] = $definition;
|
||||
$map[$this->getRoute($routes, $name) . "\\{$name}"] = $definition;
|
||||
}
|
||||
|
||||
return $map;
|
||||
|
||||
@ -110,13 +110,13 @@ class RegistrationController extends Controller
|
||||
|
||||
// Create a temporay $user so we can get the attributes, then get
|
||||
// the intersection between the $form fields and the $user fields.
|
||||
$user = $this->make(User::class, [] );
|
||||
$user = $this->make(User::class, []);
|
||||
$fields = array_intersect_key($form->attributes, $user->attributes);
|
||||
|
||||
// Becomes password_hash
|
||||
// Becomes password_hash
|
||||
$fields['password'] = $form['password'];
|
||||
|
||||
$user = $this->make(User::class, [], $fields );
|
||||
$user = $this->make(User::class, [], $fields);
|
||||
|
||||
$user->setScenario('register');
|
||||
$mailService = MailFactory::makeWelcomeMailerService($user);
|
||||
|
||||
@ -37,7 +37,7 @@ class AccessRuleFilter extends AccessRule
|
||||
/** @var User $identity */
|
||||
$identity = $user->identity;
|
||||
if (!$identity->gdpr_consent) {
|
||||
Yii::$app->response->redirect([ "/$consentAction"])->send();
|
||||
Yii::$app->response->redirect(["/{$consentAction}"])->send();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,8 +13,8 @@ namespace Da\User\Helper;
|
||||
|
||||
use Yii;
|
||||
use yii\base\Exception;
|
||||
use yii\base\Security;
|
||||
use yii\base\InvalidConfigException;
|
||||
use yii\base\Security;
|
||||
|
||||
class SecurityHelper
|
||||
{
|
||||
@ -76,8 +76,7 @@ class SecurityHelper
|
||||
if (!isset($minPasswordRequirements)) {
|
||||
if (isset(Yii::$app->getModule('user')->minPasswordRequirements)) {
|
||||
$minPasswordRequirements = Yii::$app->getModule('user')->minPasswordRequirements;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$minPasswordRequirements = [
|
||||
'lower' => 1,
|
||||
'digit' => 1,
|
||||
|
||||
@ -25,7 +25,7 @@ use yii\base\InvalidParamException;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
/**
|
||||
* @property int $user_id
|
||||
* @property int $user_id
|
||||
* @property string $name
|
||||
* @property string $public_email
|
||||
* @property string $gravatar_email
|
||||
@ -34,7 +34,7 @@ use yii\db\ActiveRecord;
|
||||
* @property string $website
|
||||
* @property string $bio
|
||||
* @property string $timezone
|
||||
* @property User $user
|
||||
* @property User $user
|
||||
*/
|
||||
class Profile extends ActiveRecord
|
||||
{
|
||||
|
||||
@ -22,17 +22,17 @@ use yii\helpers\Url;
|
||||
|
||||
/**
|
||||
* /**
|
||||
* @property int $id Id
|
||||
* @property int $user_id User id, null if account is not bind to user
|
||||
* @property string $provider Name of service
|
||||
* @property string $client_id Account id
|
||||
* @property string $data Account properties returned by social network (json encoded)
|
||||
* @property string $decodedData Json-decoded properties
|
||||
* @property int $id Id
|
||||
* @property int $user_id User id, null if account is not bind to user
|
||||
* @property string $provider Name of service
|
||||
* @property string $client_id Account id
|
||||
* @property string $data Account properties returned by social network (json encoded)
|
||||
* @property string $decodedData Json-decoded properties
|
||||
* @property string $code
|
||||
* @property string $email
|
||||
* @property string $username
|
||||
* @property int $created_at
|
||||
* @property User $user User that this account is connected for
|
||||
* @property int $created_at
|
||||
* @property User $user User that this account is connected for
|
||||
*/
|
||||
class SocialNetworkAccount extends ActiveRecord
|
||||
{
|
||||
|
||||
@ -24,13 +24,13 @@ use yii\helpers\Url;
|
||||
/**
|
||||
* Token Active Record model.
|
||||
*
|
||||
* @property int $user_id
|
||||
* @property int $user_id
|
||||
* @property string $code
|
||||
* @property int $type
|
||||
* @property int $type
|
||||
* @property string $url
|
||||
* @property bool $isExpired
|
||||
* @property int $created_at
|
||||
* @property User $user
|
||||
* @property bool $isExpired
|
||||
* @property int $created_at
|
||||
* @property User $user
|
||||
*/
|
||||
class Token extends ActiveRecord
|
||||
{
|
||||
|
||||
@ -31,33 +31,33 @@ use yii\web\IdentityInterface;
|
||||
*
|
||||
* @property bool $isAdmin
|
||||
* @property bool $isBlocked
|
||||
* @property bool $isConfirmed whether user account has been confirmed or not
|
||||
* @property bool $gdpr_deleted whether user requested deletion of his account
|
||||
* @property bool $gdpr_consent whether user has consent personal data processing
|
||||
* @property bool $isConfirmed whether user account has been confirmed or not
|
||||
* @property bool $gdpr_deleted whether user requested deletion of his account
|
||||
* @property bool $gdpr_consent whether user has consent personal data processing
|
||||
*
|
||||
* Database fields:
|
||||
* @property int $id
|
||||
* @property string $username
|
||||
* @property string $email
|
||||
* @property string $unconfirmed_email
|
||||
* @property string $password_hash
|
||||
* @property string $auth_key
|
||||
* @property string $auth_tf_key
|
||||
* @property int $auth_tf_enabled
|
||||
* @property string $registration_ip
|
||||
* @property int $confirmed_at
|
||||
* @property int $blocked_at
|
||||
* @property int $flags
|
||||
* @property int $created_at
|
||||
* @property int $updated_at
|
||||
* @property int $last_login_at
|
||||
* @property int $gdpr_consent_date date of agreement of data processing
|
||||
* @property string $last_login_ip
|
||||
* @property int $password_changed_at
|
||||
* @property int $password_age
|
||||
* Defined relations:
|
||||
* @property int $id
|
||||
* @property string $username
|
||||
* @property string $email
|
||||
* @property string $unconfirmed_email
|
||||
* @property string $password_hash
|
||||
* @property string $auth_key
|
||||
* @property string $auth_tf_key
|
||||
* @property int $auth_tf_enabled
|
||||
* @property string $registration_ip
|
||||
* @property int $confirmed_at
|
||||
* @property int $blocked_at
|
||||
* @property int $flags
|
||||
* @property int $created_at
|
||||
* @property int $updated_at
|
||||
* @property int $last_login_at
|
||||
* @property int $gdpr_consent_date date of agreement of data processing
|
||||
* @property string $last_login_ip
|
||||
* @property int $password_changed_at
|
||||
* @property int $password_age
|
||||
* Defined relations:
|
||||
* @property SocialNetworkAccount[] $socialNetworkAccounts
|
||||
* @property Profile $profile
|
||||
* @property Profile $profile
|
||||
*/
|
||||
class User extends ActiveRecord implements IdentityInterface
|
||||
{
|
||||
|
||||
@ -229,11 +229,11 @@ class Module extends BaseModule
|
||||
* @var boolean whether to disable IP logging into user table
|
||||
*/
|
||||
public $disableIpLogging = false;
|
||||
|
||||
|
||||
/**
|
||||
* @var array Minimum requirements when a new password is automatically generated.
|
||||
* Array structure: `requirement => minimum number characters`.
|
||||
*
|
||||
* Array structure: `requirement => minimum number characters`.
|
||||
*
|
||||
* Possible array keys:
|
||||
* - lower: minimum number of lowercase characters;
|
||||
* - upper: minimum number of uppercase characters;
|
||||
|
||||
@ -19,7 +19,7 @@ use Da\User\Traits\MailAwareTrait;
|
||||
class UserConfirmationService implements ServiceInterface
|
||||
{
|
||||
use MailAwareTrait;
|
||||
|
||||
|
||||
protected $model;
|
||||
|
||||
public function __construct(User $model)
|
||||
@ -31,7 +31,7 @@ class UserConfirmationService implements ServiceInterface
|
||||
{
|
||||
$model = $this->model;
|
||||
$event = $this->make(UserEvent::class, [$model]);
|
||||
|
||||
|
||||
$this->model->trigger(UserEvent::EVENT_BEFORE_CONFIRMATION, $event);
|
||||
if ((bool)$this->model->updateAttributes(['confirmed_at' => time()])) {
|
||||
$this->model->trigger(UserEvent::EVENT_AFTER_CONFIRMATION, $event);
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/**
|
||||
* @var \Da\User\Module $module
|
||||
|
||||
Reference in New Issue
Block a user