mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-20 10:02:29 +00:00
Updated Rector to commit e2ec807d3c4b2529533bfac5eb2a2b6717fd58c2
e2ec807d3c
[CodingStyle] Skip filled by construct on AddArrayDefaultToArrayPropertyRector (#4549)
This commit is contained in:
parent
78d51cc3eb
commit
20d3da40c6
|
@ -19,6 +19,7 @@ use Rector\CodingStyle\TypeAnalyzer\IterableTypeAnalyzer;
|
|||
use Rector\Core\NodeAnalyzer\PropertyFetchAnalyzer;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Privatization\NodeManipulator\VisibilityManipulator;
|
||||
use Rector\TypeDeclaration\AlreadyAssignDetector\ConstructorAssignDetector;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
|
@ -42,11 +43,17 @@ final class AddArrayDefaultToArrayPropertyRector extends AbstractRector
|
|||
* @var \Rector\Privatization\NodeManipulator\VisibilityManipulator
|
||||
*/
|
||||
private $visibilityManipulator;
|
||||
public function __construct(PropertyFetchAnalyzer $propertyFetchAnalyzer, IterableTypeAnalyzer $iterableTypeAnalyzer, VisibilityManipulator $visibilityManipulator)
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\TypeDeclaration\AlreadyAssignDetector\ConstructorAssignDetector
|
||||
*/
|
||||
private $constructorAssignDetector;
|
||||
public function __construct(PropertyFetchAnalyzer $propertyFetchAnalyzer, IterableTypeAnalyzer $iterableTypeAnalyzer, VisibilityManipulator $visibilityManipulator, ConstructorAssignDetector $constructorAssignDetector)
|
||||
{
|
||||
$this->propertyFetchAnalyzer = $propertyFetchAnalyzer;
|
||||
$this->iterableTypeAnalyzer = $iterableTypeAnalyzer;
|
||||
$this->visibilityManipulator = $visibilityManipulator;
|
||||
$this->constructorAssignDetector = $constructorAssignDetector;
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
|
@ -112,7 +119,7 @@ CODE_SAMPLE
|
|||
private function collectPropertyNamesWithMissingDefaultArray(Class_ $class) : array
|
||||
{
|
||||
$propertyNames = [];
|
||||
$this->traverseNodesWithCallable($class, function (Node $node) use(&$propertyNames) {
|
||||
$this->traverseNodesWithCallable($class, function (Node $node) use($class, &$propertyNames) {
|
||||
if (!$node instanceof Property) {
|
||||
return null;
|
||||
}
|
||||
|
@ -127,7 +134,11 @@ CODE_SAMPLE
|
|||
if ($this->visibilityManipulator->isReadonly($node)) {
|
||||
return null;
|
||||
}
|
||||
$propertyNames[] = $this->getName($propertyProperty);
|
||||
$propertyName = $this->getName($propertyProperty);
|
||||
if ($this->constructorAssignDetector->isPropertyAssigned($class, $propertyName)) {
|
||||
return null;
|
||||
}
|
||||
$propertyNames[] = $propertyName;
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '0ff50c06d0c90ed0a678fd56261ab40b25f8b29f';
|
||||
public const PACKAGE_VERSION = 'e2ec807d3c4b2529533bfac5eb2a2b6717fd58c2';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-07-20 14:39:16';
|
||||
public const RELEASE_DATE = '2023-07-20 11:39:23';
|
||||
/**
|
||||
* @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 ComposerAutoloaderInit177a1ab00f34054189b1b5f702c32392::getLoader();
|
||||
return ComposerAutoloaderInit8466a72b22dc4378b8a06c2d4a0e540d::getLoader();
|
||||
|
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit177a1ab00f34054189b1b5f702c32392
|
||||
class ComposerAutoloaderInit8466a72b22dc4378b8a06c2d4a0e540d
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,17 +22,17 @@ class ComposerAutoloaderInit177a1ab00f34054189b1b5f702c32392
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit177a1ab00f34054189b1b5f702c32392', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit8466a72b22dc4378b8a06c2d4a0e540d', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit177a1ab00f34054189b1b5f702c32392', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit8466a72b22dc4378b8a06c2d4a0e540d', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit177a1ab00f34054189b1b5f702c32392::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit8466a72b22dc4378b8a06c2d4a0e540d::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit177a1ab00f34054189b1b5f702c32392::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit8466a72b22dc4378b8a06c2d4a0e540d::$files;
|
||||
$requireFile = \Closure::bind(static function ($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 ComposerStaticInit177a1ab00f34054189b1b5f702c32392
|
||||
class ComposerStaticInit8466a72b22dc4378b8a06c2d4a0e540d
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
|
@ -3023,9 +3023,9 @@ class ComposerStaticInit177a1ab00f34054189b1b5f702c32392
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit177a1ab00f34054189b1b5f702c32392::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit177a1ab00f34054189b1b5f702c32392::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit177a1ab00f34054189b1b5f702c32392::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit8466a72b22dc4378b8a06c2d4a0e540d::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit8466a72b22dc4378b8a06c2d4a0e540d::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit8466a72b22dc4378b8a06c2d4a0e540d::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user