Update PHP-CS-Fixer to v3.x (#460)
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -47,8 +47,7 @@ codeception.yml
|
||||
|
||||
# Code Style Checkers and Mess Detectors
|
||||
/phpcs.xml
|
||||
/.php_cs.cache
|
||||
/.php_cs
|
||||
.php-cs-fixer.cache
|
||||
|
||||
# composer
|
||||
composer.lock
|
||||
|
||||
43
.php-cs-fixer.dist.php
Normal file
43
.php-cs-fixer.dist.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
$header = <<<'EOF'
|
||||
This file is part of the 2amigos/yii2-usuario project.
|
||||
|
||||
(c) 2amigOS! <http://2amigos.us/>
|
||||
|
||||
For the full copyright and license information, please view
|
||||
the LICENSE file that was distributed with this source code.
|
||||
EOF;
|
||||
|
||||
|
||||
$finder = PhpCsFixer\Finder::create()
|
||||
->exclude(['resources'])
|
||||
->in("src/User")
|
||||
;
|
||||
|
||||
$config = new PhpCsFixer\Config();
|
||||
return $config->setRules([
|
||||
'@PSR1' => true,
|
||||
'@PSR2' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'header_comment' => ['header' => $header],
|
||||
'combine_consecutive_unsets' => true,
|
||||
'no_extra_blank_lines' => [
|
||||
'tokens' => ['break', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'switch', 'throw', 'use', 'use_trait',],
|
||||
],
|
||||
'no_useless_else' => true,
|
||||
'no_useless_return' => true,
|
||||
'ordered_class_elements' => true,
|
||||
'ordered_imports' => true,
|
||||
'phpdoc_add_missing_param_annotation' => true,
|
||||
'phpdoc_order' => true,
|
||||
'phpdoc_align' => true,
|
||||
'no_trailing_whitespace' => true,
|
||||
'no_whitespace_in_blank_line' => true,
|
||||
'no_trailing_comma_in_singleline_array' => true,
|
||||
'no_whitespace_before_comma_in_array' => true,
|
||||
'trim_array_spaces' => true,
|
||||
'explicit_string_variable' => true,
|
||||
'binary_operator_spaces' => true,
|
||||
])
|
||||
->setFinder($finder)
|
||||
;
|
||||
49
.php_cs.dist
49
.php_cs.dist
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
$header = <<<'EOF'
|
||||
This file is part of the 2amigos/yii2-usuario project.
|
||||
|
||||
(c) 2amigOS! <http://2amigos.us/>
|
||||
|
||||
For the full copyright and license information, please view
|
||||
the LICENSE file that was distributed with this source code.
|
||||
EOF;
|
||||
|
||||
$finder = PhpCsFixer\Finder::create()
|
||||
->exclude([
|
||||
'.github',
|
||||
'docs',
|
||||
'temp',
|
||||
'tests',
|
||||
'vendor',
|
||||
'src/User/resources'
|
||||
])
|
||||
->in(__DIR__);
|
||||
|
||||
return PhpCsFixer\Config::create()
|
||||
->setRules(array(
|
||||
'@PSR1' => true,
|
||||
'@PSR2' => true,
|
||||
'header_comment' => ['header' => $header],
|
||||
'array_syntax' => array('syntax' => 'short'),
|
||||
'combine_consecutive_unsets' => true,
|
||||
'no_extra_consecutive_blank_lines' => array(
|
||||
'break',
|
||||
'continue',
|
||||
'extra',
|
||||
'return',
|
||||
'throw',
|
||||
'use',
|
||||
'parenthesis_brace_block',
|
||||
'square_brace_block',
|
||||
'curly_brace_block'
|
||||
),
|
||||
'no_useless_else' => true,
|
||||
'no_useless_return' => true,
|
||||
'ordered_class_elements' => true,
|
||||
'ordered_imports' => true,
|
||||
'phpdoc_add_missing_param_annotation' => true,
|
||||
'phpdoc_order' => true,
|
||||
'phpdoc_align' => true
|
||||
|
||||
))
|
||||
->setFinder($finder);
|
||||
@ -1,7 +1,6 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 1.6.0 work in progress
|
||||
|
||||
**WARNING**: this release (long time due) makes a step forward in PHP
|
||||
compatibility, leaving behind obsolete versions. While yii2-usuario should
|
||||
still work without issues on 5.6, from now on testing and development will
|
||||
@ -24,6 +23,7 @@ look forward and manitain only >=7.4 versions.
|
||||
- Ehn #412: Allow role names to support UTF-8 chars (4khobta)
|
||||
- Ehn #448: Remove deprecated SwiftMailer, use SymfonyMailer instead (TonisOrmisson)
|
||||
- Ehn #428: Translations of the placeholders in the login widget (anapaulaxenon)
|
||||
- Update PHP-CS-Fixer configuration to new version (maxxer)
|
||||
|
||||
## 1.5.1 April 5, 2020
|
||||
|
||||
|
||||
@ -52,10 +52,9 @@
|
||||
"2amigos/qrcode-library": "Needed if you want to enable 2FA with QR Code generation. Require version ^1.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^3",
|
||||
"php": ">=7.4",
|
||||
|
||||
"yiisoft/yii2-symfonymailer": "~2.0.0",
|
||||
"friendsofphp/php-cs-fixer": "^2.3",
|
||||
"squizlabs/php_codesniffer": "*",
|
||||
"phpmd/phpmd": "@stable",
|
||||
"codeception/verify": "^0.3.3",
|
||||
|
||||
@ -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
|
||||
$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,
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
*/
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/**
|
||||
* @var \Da\User\Module $module
|
||||
|
||||
Reference in New Issue
Block a user