Skip to content

Commit

Permalink
fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Nov 25, 2023
1 parent ab5f557 commit 896dd54
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
15 changes: 6 additions & 9 deletions requirement-checker/rector-src.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@
use Rector\Set\ValueObject\DowngradeLevelSetList;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$applyCommonConfig = require __DIR__.'/rector.php';

return static function (RectorConfig $rectorConfig) use ($applyCommonConfig): void {
$applyCommonConfig($rectorConfig);

$rectorConfig->paths([
__DIR__ . '/src',
]);

$rectorConfig->autoloadPaths([
__DIR__ . '/vendor/autoload.php',
__DIR__ . '/../vendor-bin/rector/vendor/autoload.php',
]);

$rectorConfig->importNames();

$rectorConfig->sets([
// TODO
LevelSetList::UP_TO_PHP_72,
// DowngradeLevelSetList::DOWN_TO_PHP_72,
]);
};
18 changes: 10 additions & 8 deletions requirement-checker/rector-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$applyCommonConfig = require __DIR__.'/rector.php';

return static function (RectorConfig $rectorConfig) use ($applyCommonConfig): void {
$applyCommonConfig($rectorConfig);

$rectorConfig->paths([
__DIR__ . '/tests',
]);

$rectorConfig->autoloadPaths([
__DIR__ . '/vendor/autoload.php',
__DIR__ . '/../vendor-bin/rector/vendor/autoload.php',
]);

$rectorConfig->importNames();

$rectorConfig->sets([
LevelSetList::UP_TO_PHP_82,
]);

$rectorConfig->skip([
ClosureToArrowFunctionRector::class
]);
};
17 changes: 17 additions & 0 deletions requirement-checker/rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\DowngradeLevelSetList;
use Rector\Set\ValueObject\LevelSetList;

// Common configuration
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->autoloadPaths([
__DIR__ . '/vendor/autoload.php',
__DIR__ . '/../vendor-bin/rector/vendor/autoload.php',
]);

$rectorConfig->importNames();
};

0 comments on commit 896dd54

Please sign in to comment.