Skip to content

Commit

Permalink
use paths() in test
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Apr 7, 2022
1 parent 2b79742 commit c04ce87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
10 changes: 3 additions & 7 deletions e2e/use-rector-configurator/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Core\Configuration\Option;
use Rector\DowngradePhp81\Rector\Property\DowngradeReadonlyPropertyRector;

return static function (RectorConfig $rectorConfigurator): void {
$parameters = $rectorConfigurator->parameters();

$parameters->set(Option::PATHS, [
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/src',
]);

$services = $rectorConfigurator->services();
$services = $rectorConfig->services();
$services->set(DowngradeReadonlyPropertyRector::class);
};

3 changes: 2 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Rector\CodingStyle\Rector\ClassMethod\ReturnArrayClassMethodToYieldRector;
use Rector\CodingStyle\Rector\MethodCall\PreferThisOrSelfMethodCallRector;
use Rector\CodingStyle\ValueObject\ReturnArrayClassMethodToYield;
use Rector\Config\RectorConfig;
use Rector\Core\Configuration\Option;
use Rector\Nette\Set\NetteSetList;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
Expand All @@ -17,7 +18,7 @@
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;

return static function (\Rector\Config\RectorConfig $rectorConfig): void {
return static function (RectorConfig $rectorConfig): void {
// include the latest PHP version + all bellow in one config!
$rectorConfig->import(LevelSetList::UP_TO_PHP_81);

Expand Down

0 comments on commit c04ce87

Please sign in to comment.