mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-31 20:51:46 +01:00
Updated Rector to commit b8aff0861788200f2e098191118d1e5e8948a242
b8aff08617
Do not apply property promotion to parameters with the SensitiveParameter attribute (#3165)
This commit is contained in:
parent
4397f883bd
commit
50000ad3ec
@ -24,6 +24,7 @@ use Rector\DeadCode\PhpDoc\TagRemover\VarTagRemover;
|
||||
use Rector\Naming\VariableRenamer;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\Php80\Guard\MakePropertyPromotionGuard;
|
||||
use Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer;
|
||||
use Rector\Php80\NodeAnalyzer\PromotedPropertyCandidateResolver;
|
||||
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
||||
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
|
||||
@ -81,7 +82,12 @@ final class ClassPropertyAssignToConstructorPromotionRector extends AbstractRect
|
||||
* @var \Rector\Php80\Guard\MakePropertyPromotionGuard
|
||||
*/
|
||||
private $makePropertyPromotionGuard;
|
||||
public function __construct(PromotedPropertyCandidateResolver $promotedPropertyCandidateResolver, VariableRenamer $variableRenamer, VarTagRemover $varTagRemover, ParamAnalyzer $paramAnalyzer, PhpDocTypeChanger $phpDocTypeChanger, MakePropertyPromotionGuard $makePropertyPromotionGuard)
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Php80\NodeAnalyzer\PhpAttributeAnalyzer
|
||||
*/
|
||||
private $phpAttributeAnalyzer;
|
||||
public function __construct(PromotedPropertyCandidateResolver $promotedPropertyCandidateResolver, VariableRenamer $variableRenamer, VarTagRemover $varTagRemover, ParamAnalyzer $paramAnalyzer, PhpDocTypeChanger $phpDocTypeChanger, MakePropertyPromotionGuard $makePropertyPromotionGuard, PhpAttributeAnalyzer $phpAttributeAnalyzer)
|
||||
{
|
||||
$this->promotedPropertyCandidateResolver = $promotedPropertyCandidateResolver;
|
||||
$this->variableRenamer = $variableRenamer;
|
||||
@ -89,6 +95,7 @@ final class ClassPropertyAssignToConstructorPromotionRector extends AbstractRect
|
||||
$this->paramAnalyzer = $paramAnalyzer;
|
||||
$this->phpDocTypeChanger = $phpDocTypeChanger;
|
||||
$this->makePropertyPromotionGuard = $makePropertyPromotionGuard;
|
||||
$this->phpAttributeAnalyzer = $phpAttributeAnalyzer;
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
@ -209,6 +216,9 @@ CODE_SAMPLE
|
||||
if ($param->variadic) {
|
||||
return \true;
|
||||
}
|
||||
if ($this->phpAttributeAnalyzer->hasPhpAttribute($param, 'SensitiveParameter')) {
|
||||
return \true;
|
||||
}
|
||||
if ($this->paramAnalyzer->isNullable($param)) {
|
||||
/** @var NullableType $type */
|
||||
$type = $param->type;
|
||||
|
@ -17,12 +17,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '7636b888661966e3679770d868481cd02e31517f';
|
||||
public const PACKAGE_VERSION = 'b8aff0861788200f2e098191118d1e5e8948a242';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-12-07 16:24:55';
|
||||
public const RELEASE_DATE = '2022-12-07 16:27:36';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInited0dc9635b0264d646fb72918d6c6cc5::getLoader();
|
||||
return ComposerAutoloaderInitdd1c9fbc0381d38245b3815a3cf777f9::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInited0dc9635b0264d646fb72918d6c6cc5
|
||||
class ComposerAutoloaderInitdd1c9fbc0381d38245b3815a3cf777f9
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,19 @@ class ComposerAutoloaderInited0dc9635b0264d646fb72918d6c6cc5
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInited0dc9635b0264d646fb72918d6c6cc5', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitdd1c9fbc0381d38245b3815a3cf777f9', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInited0dc9635b0264d646fb72918d6c6cc5', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitdd1c9fbc0381d38245b3815a3cf777f9', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInited0dc9635b0264d646fb72918d6c6cc5::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitdd1c9fbc0381d38245b3815a3cf777f9::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInited0dc9635b0264d646fb72918d6c6cc5::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitdd1c9fbc0381d38245b3815a3cf777f9::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequireed0dc9635b0264d646fb72918d6c6cc5($fileIdentifier, $file);
|
||||
composerRequiredd1c9fbc0381d38245b3815a3cf777f9($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +46,7 @@ class ComposerAutoloaderInited0dc9635b0264d646fb72918d6c6cc5
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequireed0dc9635b0264d646fb72918d6c6cc5($fileIdentifier, $file)
|
||||
function composerRequiredd1c9fbc0381d38245b3815a3cf777f9($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInited0dc9635b0264d646fb72918d6c6cc5
|
||||
class ComposerStaticInitdd1c9fbc0381d38245b3815a3cf777f9
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3018,9 +3018,9 @@ class ComposerStaticInited0dc9635b0264d646fb72918d6c6cc5
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInited0dc9635b0264d646fb72918d6c6cc5::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInited0dc9635b0264d646fb72918d6c6cc5::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInited0dc9635b0264d646fb72918d6c6cc5::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitdd1c9fbc0381d38245b3815a3cf777f9::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitdd1c9fbc0381d38245b3815a3cf777f9::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitdd1c9fbc0381d38245b3815a3cf777f9::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user