diff --git a/composer.json b/composer.json index ff2f2702..49d3625f 100644 --- a/composer.json +++ b/composer.json @@ -84,12 +84,14 @@ }, "require-dev": { "dama/doctrine-test-bundle": "^7.0", + "doctrine/doctrine-fixtures-bundle": "^3.2", "ekino/phpstan-banned-code": "^v1.0.0", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.4.7", "phpstan/phpstan-doctrine": "^1.2.11", "phpstan/phpstan-symfony": "^1.1.7", "psalm/plugin-symfony": "^v5.0.1", + "rector/rector": "^0.16.0", "roave/security-advisories": "dev-latest", "symfony/browser-kit": "^5.2", "symfony/css-selector": "^5.2", @@ -99,8 +101,7 @@ "symfony/stopwatch": "^5.2", "symfony/web-profiler-bundle": "^5.2", "symplify/easy-coding-standard": "^11.0", - "vimeo/psalm": "^5.6.0", - "doctrine/doctrine-fixtures-bundle": "^3.2" + "vimeo/psalm": "^5.6.0" }, "suggest": { "ext-bcmath": "Used to improve price calculation performance", diff --git a/composer.lock b/composer.lock index 2fd6f728..0110dcba 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bc9721bfdd7cdf88630f55f2ff97a28d", + "content-hash": "b0d4bf26f478ca8451e65e618de7bde7", "packages": [ { "name": "beberlei/assert", @@ -14572,6 +14572,67 @@ }, "time": "2023-04-21T15:40:12+00:00" }, + { + "name": "rector/rector", + "version": "0.16.0", + "source": { + "type": "git", + "url": "https://github.com/rectorphp/rector.git", + "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/2125ff71ea05b079562a8f59ca48a97eb78dc07f", + "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "phpstan/phpstan": "^1.10.14" + }, + "conflict": { + "rector/rector-doctrine": "*", + "rector/rector-downgrade-php": "*", + "rector/rector-phpunit": "*", + "rector/rector-symfony": "*" + }, + "bin": [ + "bin/rector" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.15-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], + "support": { + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/0.16.0" + }, + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2023-05-05T12:12:17+00:00" + }, { "name": "roave/security-advisories", "version": "dev-latest", @@ -15962,7 +16023,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.4 || ^8.0", + "php": "^8.1", "ext-ctype": "*", "ext-dom": "*", "ext-gd": "*", diff --git a/rector.php b/rector.php new file mode 100644 index 00000000..c8545b90 --- /dev/null +++ b/rector.php @@ -0,0 +1,34 @@ +symfonyContainerXml(__DIR__ . '/var/cache/dev/App_KernelDevDebugContainer.xml'); + $rectorConfig->symfonyContainerPhp(__DIR__ . '/tests/symfony-container.php'); + + $rectorConfig->paths([ + __DIR__ . '/config', + __DIR__ . '/public', + __DIR__ . '/src', + __DIR__ . '/tests', + ]); + + // register a single rule + //$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); + + // define sets of rules + $rectorConfig->sets([ + //SetList::CODE_QUALITY, + //LevelSetList::UP_TO_PHP_81, + SymfonyLevelSetList::UP_TO_SYMFONY_62, + //SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES, + SymfonySetList::SYMFONY_CODE_QUALITY, + ]); +}; diff --git a/tests/symfony-container.php b/tests/symfony-container.php new file mode 100644 index 00000000..f4b63872 --- /dev/null +++ b/tests/symfony-container.php @@ -0,0 +1,10 @@ +boot(); + +return $appKernel->getContainer();