build: add Rector

This commit is contained in:
Ben Goldsworthy 2021-05-02 10:15:44 +01:00
parent e8e41c6c9d
commit 35745a7623
3 changed files with 2221 additions and 2709 deletions

View file

@ -28,9 +28,9 @@
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"phpcompatibility/php-compatibility": "*",
"wp-coding-standards/wpcs": "^2.3",
"phpdocumentor/phpdocumentor": "^3.0",
"marcocesarato/php-conventional-changelog": "^1.9",
"phpcompatibility/phpcompatibility-wp": "*"
"phpcompatibility/phpcompatibility-wp": "*",
"rector/rector": "^0.10.16"
},
"prefer-stable": true
}

4884
composer.lock generated

File diff suppressed because it is too large Load diff

30
rector.php Normal file
View file

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
use Rector\Core\Configuration\Option;
use Rector\Set\ValueObject\SetList;
use Rector\Set\ValueObject\DowngradeSetList;
use Rector\Core\ValueObject\PhpVersion;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
// get parameters
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [
__DIR__ . '/src',
]);
// Define what rule sets will be applied
$parameters->set(Option::SETS, [
// SetList::CODE_QUALITY,
SetList::DEAD_CODE,
// DowngradeSetList::PHP_80,
// DowngradeSetList::PHP_74,
// DowngradeSetList::PHP_73,
//DowngradeSetList::PHP_72,
]);
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_71);
};