Updated Rector to commit 66e57260e66e32c78fac0738d69b49e009b348d6

66e57260e6 [Set] Add new rector-preset set to have opiniated rector rules that can be enabled in rector-src and its extension (#5924)
This commit is contained in:
Tomas Votruba 2024-05-30 07:30:01 +00:00
parent c9f15d2f2a
commit ad8eee4201
4 changed files with 32 additions and 3 deletions

View File

@ -0,0 +1,22 @@
<?php
declare (strict_types=1);
namespace RectorPrefix202405;
use Rector\CodeQuality\Rector\FuncCall\BoolvalToTypeCastRector;
use Rector\CodeQuality\Rector\FuncCall\FloatvalToTypeCastRector;
use Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector;
use Rector\CodeQuality\Rector\FuncCall\StrvalToTypeCastRector;
use Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector;
use Rector\CodingStyle\Rector\Closure\StaticClosureRector;
use Rector\CodingStyle\Rector\Plus\UseIncrementAssignRector;
use Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector;
use Rector\Config\RectorConfig;
use Rector\Privatization\Rector\Class_\FinalizeTestCaseClassRector;
use Rector\TypeDeclaration\Rector\BooleanAnd\BinaryOpNullableToInstanceofRector;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\IncreaseDeclareStrictTypesRector;
use Rector\TypeDeclaration\Rector\While_\WhileNullableToInstanceofRector;
return static function (RectorConfig $rectorConfig) : void {
$rectorConfig->rules([DeclareStrictTypesRector::class, BinaryOpNullableToInstanceofRector::class, WhileNullableToInstanceofRector::class, IntvalToTypeCastRector::class, StrvalToTypeCastRector::class, BoolvalToTypeCastRector::class, FloatvalToTypeCastRector::class, IncreaseDeclareStrictTypesRector::class, StaticClosureRector::class, StaticArrowFunctionRector::class, PostIncDecToPreIncDecRector::class, UseIncrementAssignRector::class, FinalizeTestCaseClassRector::class]);
};

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '30669553df27580da9d1f1367580b784a989808b';
public const PACKAGE_VERSION = '66e57260e66e32c78fac0738d69b49e009b348d6';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-05-29 21:27:10';
public const RELEASE_DATE = '2024-05-30 14:26:47';
/**
* @var int
*/

View File

@ -383,7 +383,7 @@ final class RectorConfigBuilder
}
return $this;
}
public function withPreparedSets(bool $deadCode = \false, bool $codeQuality = \false, bool $codingStyle = \false, bool $typeDeclarations = \false, bool $privatization = \false, bool $naming = \false, bool $instanceOf = \false, bool $earlyReturn = \false, bool $strictBooleans = \false, bool $carbon = \false) : self
public function withPreparedSets(bool $deadCode = \false, bool $codeQuality = \false, bool $codingStyle = \false, bool $typeDeclarations = \false, bool $privatization = \false, bool $naming = \false, bool $instanceOf = \false, bool $earlyReturn = \false, bool $strictBooleans = \false, bool $carbon = \false, bool $rectorPreset = \false) : self
{
if ($deadCode) {
$this->sets[] = SetList::DEAD_CODE;
@ -415,6 +415,9 @@ final class RectorConfigBuilder
if ($carbon) {
$this->sets[] = SetList::CARBON;
}
if ($rectorPreset) {
$this->sets[] = SetList::RECTOR_PRESET;
}
return $this;
}
/**

View File

@ -33,6 +33,10 @@ final class SetList implements SetListInterface
* @var string
*/
public const NAMING = __DIR__ . '/../../../config/set/naming.php';
/**
* @var string
*/
public const RECTOR_PRESET = __DIR__ . '/../../../config/set/rector-preset.php';
/**
* @var string
*/