targeting the current version of PHP that's running vs basing it off of composer.json's "php": ">=5.0.0" #9616
-
|
Here's my rector.php file: <?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\Set\PHPUnitSetList;
return RectorConfig::configure()
->withPaths([
__DIR__ . '/tests',
])
->withSets([
PHPUnitSetList::PHPUNIT_80,
]);I additionally have this in my composer.json: When I run I want the rule to be applied but don't want to remove the I guess I could add If it weren't for the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
You can add if else based on environment, eg: on github vs local in rector.php so the set php version will adapt based on target php version. $rectorConfig = RectorConfig::configure()
->withPaths([
__DIR__ . '/tests',
])
->withSets([
PHPUnitSetList::PHPUNIT_80,
]);
if (getenv("some_env")) {
$rectorConfig = $rectorConfig->withPhpVersion(80000);
}
return $rectorConfig; |
Beta Was this translation helpful? Give feedback.
You can add if else based on environment, eg: on github vs local in rector.php so the set php version will adapt based on target php version.