Skip to content

Commit

Permalink
switch getRulesWithConfiguration() to config first approach
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Feb 9, 2021
1 parent f001ee7 commit 7eab4bb
Show file tree
Hide file tree
Showing 206 changed files with 2,950 additions and 1,824 deletions.
1 change: 1 addition & 0 deletions config/set/downgrade-php71.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

// skip classes used in PHP DocBlocks, like in /** @var \Some\Class */ [default: true]
$parameters->set(Option::IMPORT_DOC_BLOCKS, false);

$services->set(DowngradeClassConstantVisibilityRector::class);
$services->set(DowngradePipeToMultiCatchExceptionRector::class);
$services->set(SymmetricArrayDestructuringToListRector::class);
Expand Down
1 change: 1 addition & 0 deletions config/set/downgrade-php72.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@

// skip classes used in PHP DocBlocks, like in /** @var \Some\Class */ [default: true]
$parameters->set(Option::IMPORT_DOC_BLOCKS, false);

$services->set(DowngradeParameterTypeWideningRector::class);
};
1 change: 1 addition & 0 deletions config/set/downgrade-php73.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

// skip classes used in PHP DocBlocks, like in /** @var \Some\Class */ [default: true]
$parameters->set(Option::IMPORT_DOC_BLOCKS, false);

$services->set(DowngradeTrailingCommasInFunctionCallsRector::class);
$services->set(SetCookieOptionsArrayToArgumentsRector::class);
};
1 change: 1 addition & 0 deletions config/set/downgrade-php74.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

// skip classes used in PHP DocBlocks, like in /** @var \Some\Class */ [default: true]
$parameters->set(Option::IMPORT_DOC_BLOCKS, false);

$services->set(DowngradeFreadFwriteFalsyToNegationRector::class);
$services->set(DowngradeReturnSelfTypeDeclarationRector::class);
};
1 change: 1 addition & 0 deletions config/set/downgrade-php80.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

// skip classes used in PHP DocBlocks, like in /** @var \Some\Class */ [default: true]
$parameters->set(Option::IMPORT_DOC_BLOCKS, false);

$services->set(DowngradePropertyPromotionRector::class);
$services->set(DowngradeNonCapturingCatchesRector::class);
$services->set(DowngradeMatchToSwitchRector::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Rector\__Package__\Tests\Rector\__Category__\__Name__;

use Rector\Testing\PHPUnit\AbstractRectorTestCase;
use Symplify\SmartFileSystem\SmartFileInfo;

final class __Name__Test extends AbstractRectorTestCase
{
Expand All @@ -22,14 +23,8 @@ final class __Name__Test extends AbstractRectorTestCase
yield [new \Symplify\SmartFileSystem\SmartFileInfo(__DIR__ . '/Fixture/some_class.php.inc'), '__ExtraFileName__', __DIR__ . '/Source/extra_file.php'];
}

/**
* @return mixed[]
*/
protected function getRectorsWithConfiguration(): array
protected function provideConfigFileInfo(): ?\Symplify\SmartFileSystem\SmartFileInfo
{
return [
\Rector\__Package__\Rector\__Category__\__Name__::class =>
__TestRuleConfiguration__
];
return new \Symplify\SmartFileSystem\SmartFileInfo(__DIR__ . '/configured_rule.php');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,8 @@ final class __Name__Test extends AbstractRectorTestCase
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

/**
* @return mixed[]
*/
protected function getRectorsWithConfiguration(): array
protected function provideConfigFileInfo(): ?\Symplify\SmartFileSystem\SmartFileInfo
{
return [
\Rector\__Package__\Rector\__Category__\__Name__::class =>
__TestRuleConfiguration__
];
return new \Symplify\SmartFileSystem\SmartFileInfo(__DIR__ . '/configured_rule.php');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,8 @@ final class WhateverRectorTest extends AbstractRectorTestCase
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

/**
* @return mixed[]
*/
protected function getRectorsWithConfiguration(): array
protected function provideConfigFileInfo(): ?\Symplify\SmartFileSystem\SmartFileInfo
{
return [
\Rector\ModeratePackage\Rector\MethodCall\WhateverRector::class =>
[\Rector\ModeratePackage\Rector\MethodCall\WhateverRector::CLASS_TYPE_TO_METHOD_NAME => ['SomeClass' => 'configure']]
];
return new \Symplify\SmartFileSystem\SmartFileInfo(__DIR__ . '/configured_rule.php');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,8 @@ final class WhateverRectorTest extends AbstractRectorTestCase
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
}

/**
* @return mixed[]
*/
protected function getRectorsWithConfiguration(): array
protected function provideConfigFileInfo(): ?\Symplify\SmartFileSystem\SmartFileInfo
{
return [
\Utils\Rector\Rector\MethodCall\WhateverRector::class =>
[\Utils\Rector\Rector\MethodCall\WhateverRector::CLASS_TYPE_TO_METHOD_NAME => ['SomeClass' => 'configure']]
];
return new \Symplify\SmartFileSystem\SmartFileInfo(__DIR__ . '/configured_rule.php');
}
}
Loading

0 comments on commit 7eab4bb

Please sign in to comment.