mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-14 20:39:43 +01:00
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:
parent
c9f15d2f2a
commit
ad8eee4201
22
config/set/rector-preset.php
Normal file
22
config/set/rector-preset.php
Normal 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]);
|
||||
};
|
@ -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
|
||||
*/
|
||||
|
@ -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;
|
||||
}
|
||||
/**
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user