mirror of
https://github.com/j0k3r/php-readability.git
synced 2026-09-27 06:26:17 +00:00
phpstan: Upgrade to version 2
https://github.com/phpstan/phpstan/blob/2.1.x/UPGRADING.md Required also bumping Rector since it uses PHPStan internally.
This commit is contained in:
+7
-20
@@ -3,29 +3,16 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
use Rector\Set\ValueObject\LevelSetList;
|
||||
|
||||
return static function (RectorConfig $rectorConfig): void {
|
||||
// paths to refactor; solid alternative to CLI arguments
|
||||
$rectorConfig->paths([
|
||||
return RectorConfig::configure()
|
||||
->withPaths([
|
||||
__DIR__ . '/src',
|
||||
__DIR__ . '/tests',
|
||||
]);
|
||||
|
||||
// Path to phpstan with extensions, that PHPSTan in Rector uses to determine types
|
||||
$rectorConfig->phpstanConfig(__DIR__ . '/phpstan.neon');
|
||||
|
||||
$rectorConfig->bootstrapFiles([
|
||||
])
|
||||
->withBootstrapFiles([
|
||||
__DIR__ . '/vendor/bin/.phpunit/phpunit/vendor/autoload.php',
|
||||
__DIR__ . '/vendor/autoload.php',
|
||||
]);
|
||||
|
||||
// Define what rule sets will be applied
|
||||
$rectorConfig->sets([
|
||||
LevelSetList::UP_TO_PHP_74,
|
||||
]);
|
||||
|
||||
// is your PHP version different from the one your refactor to?
|
||||
$rectorConfig->phpVersion(PhpVersion::PHP_74);
|
||||
};
|
||||
])
|
||||
->withSets([LevelSetList::UP_TO_PHP_74])
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user