Updated Rector to commit 39a6ed5d83fcb4d96adb9112e2332081b8a6bec6

39a6ed5d83 Enable rule (#2619)
This commit is contained in:
Tomas Votruba 2022-07-03 12:51:23 +00:00
parent 4153a8246a
commit 80dae040ce
9 changed files with 19 additions and 23 deletions

View File

@ -18,5 +18,5 @@ use Rector\EarlyReturn\Rector\Return_\ReturnBinaryAndToEarlyReturnRector;
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector;
use Rector\EarlyReturn\Rector\StmtsAwareInterface\ReturnEarlyIfVariableRector;
return static function (RectorConfig $rectorConfig) : void {
$rectorConfig->rules([ChangeNestedForeachIfsToEarlyContinueRector::class, ChangeAndIfToEarlyReturnRector::class, ChangeIfElseValueAssignToEarlyReturnRector::class, ChangeNestedIfsToEarlyReturnRector::class, RemoveAlwaysElseRector::class, ReturnBinaryAndToEarlyReturnRector::class, ChangeOrIfReturnToEarlyReturnRector::class, ChangeOrIfContinueToMultiContinueRector::class, ReturnAfterToEarlyOnBreakRector::class, PreparedValueToEarlyReturnRector::class, ReturnBinaryOrToEarlyReturnRector::class, ReturnEarlyIfVariableRector::class]);
$rectorConfig->rules([ChangeNestedForeachIfsToEarlyContinueRector::class, ChangeAndIfToEarlyReturnRector::class, ChangeIfElseValueAssignToEarlyReturnRector::class, ChangeNestedIfsToEarlyReturnRector::class, RemoveAlwaysElseRector::class, ReturnBinaryAndToEarlyReturnRector::class, ChangeOrIfReturnToEarlyReturnRector::class, ChangeOrIfContinueToMultiContinueRector::class, ReturnAfterToEarlyOnBreakRector::class, PreparedValueToEarlyReturnRector::class, ReturnBinaryOrToEarlyReturnRector::class, ReturnEarlyIfVariableRector::class, RemoveJustVariableAssignRector::class]);
};

View File

@ -84,8 +84,7 @@ final class ClassRenamePhpDocNodeVisitor extends AbstractPhpDocNodeVisitor
return null;
}
$identifier = clone $node;
$namespacedName = $this->resolveNamespacedName($identifier, $phpParserNode, $node->name);
$identifier->name = $namespacedName;
$identifier->name = $this->resolveNamespacedName($identifier, $phpParserNode, $node->name);
$staticType = $this->staticTypeMapper->mapPHPStanPhpDocTypeNodeToPHPStanType($identifier, $phpParserNode);
// make sure to compare FQNs
$objectType = $this->expandShortenedObjectType($staticType);

View File

@ -93,8 +93,7 @@ CODE_SAMPLE
if ($propertyToMethodCall->getNewGetMethod() !== '') {
$methodCall = $this->nodeFactory->createMethodCall($propertyFetch->var, $propertyToMethodCall->getNewGetMethod());
if ($propertyToMethodCall->getNewGetArguments() !== []) {
$args = $this->nodeFactory->createArgs($propertyToMethodCall->getNewGetArguments());
$methodCall->args = $args;
$methodCall->args = $this->nodeFactory->createArgs($propertyToMethodCall->getNewGetArguments());
}
return $methodCall;
}

View File

@ -169,8 +169,7 @@ final class PhpFileProcessor implements FileProcessorInterface
return;
}
$smartFileInfo = $file->getSmartFileInfo();
$relativeFilePath = $smartFileInfo->getRelativeFilePathFromDirectory(\getcwd());
$message = $relativeFilePath;
$message = $smartFileInfo->getRelativeFilePathFromDirectory(\getcwd());
$this->rectorOutputStyle->writeln($message);
}
}

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '45c91eb8ba874853d5717d7267c85776b2502f9d';
public const PACKAGE_VERSION = '39a6ed5d83fcb4d96adb9112e2332081b8a6bec6';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-07-03 14:37:43';
public const RELEASE_DATE = '2022-07-03 14:46:23';
/**
* @var int
*/

View File

@ -526,8 +526,7 @@ final class NodeFactory
private function createParamWithType(Variable $variable, Type $type) : Param
{
$param = new Param($variable);
$phpParserTypeNode = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($type, TypeKind::PARAM);
$param->type = $phpParserTypeNode;
$param->type = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($type, TypeKind::PARAM);
return $param;
}
/**

2
vendor/autoload.php vendored
View File

@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitdf03a708997154c9a8b37699a741603b::getLoader();
return ComposerAutoloaderInit04413fc4ee21127df693b99daa9d37b6::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitdf03a708997154c9a8b37699a741603b
class ComposerAutoloaderInit04413fc4ee21127df693b99daa9d37b6
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInitdf03a708997154c9a8b37699a741603b
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitdf03a708997154c9a8b37699a741603b', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit04413fc4ee21127df693b99daa9d37b6', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitdf03a708997154c9a8b37699a741603b', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit04413fc4ee21127df693b99daa9d37b6', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitdf03a708997154c9a8b37699a741603b::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit04413fc4ee21127df693b99daa9d37b6::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInitdf03a708997154c9a8b37699a741603b::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit04413fc4ee21127df693b99daa9d37b6::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequiredf03a708997154c9a8b37699a741603b($fileIdentifier, $file);
composerRequire04413fc4ee21127df693b99daa9d37b6($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInitdf03a708997154c9a8b37699a741603b
* @param string $file
* @return void
*/
function composerRequiredf03a708997154c9a8b37699a741603b($fileIdentifier, $file)
function composerRequire04413fc4ee21127df693b99daa9d37b6($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitdf03a708997154c9a8b37699a741603b
class ComposerStaticInit04413fc4ee21127df693b99daa9d37b6
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -3416,9 +3416,9 @@ class ComposerStaticInitdf03a708997154c9a8b37699a741603b
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitdf03a708997154c9a8b37699a741603b::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitdf03a708997154c9a8b37699a741603b::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitdf03a708997154c9a8b37699a741603b::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit04413fc4ee21127df693b99daa9d37b6::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit04413fc4ee21127df693b99daa9d37b6::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit04413fc4ee21127df693b99daa9d37b6::$classMap;
}, null, ClassLoader::class);
}