Skip to content

Commit

Permalink
Move PreferThisOrSelfMethodCallRector to PHPUnit rector package, to h…
Browse files Browse the repository at this point in the history
…andle exact cases (#4194)
  • Loading branch information
TomasVotruba committed Jun 12, 2023
1 parent ca08d86 commit a86eb69
Show file tree
Hide file tree
Showing 16 changed files with 2 additions and 493 deletions.
20 changes: 2 additions & 18 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

declare(strict_types=1);

use Rector\CodingStyle\Enum\PreferenceSelfThis;
use Rector\CodingStyle\Rector\ClassMethod\ReturnArrayClassMethodToYieldRector;
use Rector\CodingStyle\Rector\MethodCall\PreferThisOrSelfMethodCallRector;
use Rector\CodingStyle\Rector\String_\UseClassKeywordForClassNameResolutionRector;
use Rector\CodingStyle\ValueObject\ReturnArrayClassMethodToYield;
use Rector\Config\RectorConfig;
Expand All @@ -20,28 +18,21 @@
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
PHPUnitSetList::PHPUNIT_100,
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
SetList::PRIVATIZATION,
SetList::NAMING,
SetList::TYPE_DECLARATION,
SetList::INSTANCEOF,
SetList::EARLY_RETURN,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
SetList::CODING_STYLE,
SetList::STRICT_BOOLEANS,
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::PHPUNIT_100,
]);

$rectorConfig->rules([DeclareStrictTypesRector::class]);

$rectorConfig->ruleWithConfiguration(
PreferThisOrSelfMethodCallRector::class,
[
'PHPUnit\Framework\TestCase' => PreferenceSelfThis::PREFER_THIS,
]
);

$rectorConfig->ruleWithConfiguration(ReturnArrayClassMethodToYieldRector::class, [
new ReturnArrayClassMethodToYield('PHPUnit\Framework\TestCase', '*provide*'),
]);
Expand Down Expand Up @@ -99,13 +90,6 @@
__DIR__ . '/rules/DeadCode/Rector/If_/RemoveUnusedNonEmptyArrayBeforeForeachRector.php',
],

\Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector::class => [
__DIR__ . '/src/DependencyInjection',
],
\Rector\Strict\Rector\Ternary\DisallowedShortTernaryRuleFixerRector::class => [
__DIR__ . '/src/DependencyInjection',
],

\Rector\DeadCode\Rector\ConstFetch\RemovePhpVersionIdCheckRector::class => [
__DIR__ . '/src/Util/FileHasher.php',
],
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions rules/CodingStyle/Enum/PreferenceSelfThis.php

This file was deleted.

Loading

0 comments on commit a86eb69

Please sign in to comment.