sylius / sylius-rector
Rector upgrades rules for Sylius
Installs: 426 900
Dependents: 6
Suggesters: 0
Security: 0
Stars: 8
Watchers: 9
Forks: 10
Open Issues: 3
Type:rector-extension
Requires
- php: ^8.0
- rector/rector: ^1.0
Requires (Dev)
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.8
- phpstan/phpstan-strict-rules: ^1.2
- phpstan/phpstan-webmozart-assert: ^1.1
- phpunit/phpunit: ^9.5
- symplify/easy-coding-standard: ^10.0|^11.0
- symplify/package-builder: ^10.0
- symplify/phpstan-extensions: ^10.0|^11.0
- symplify/phpstan-rules: ^10.0|^11.0
- symplify/rule-doc-generator: ^10.0|^11.0
- symplify/vendor-patches: ^10.0|^11.0
Conflicts
- rector/rector: <0.11
- symplify/phpstan-rules: ^11.1
This package is auto-updated.
Last update: 2024-12-14 10:37:01 UTC
README
Installation Sylius-Standard 1.12+
Starting with Sylius-Standard 1.12 and above, we are providing a basic configuration to getting started with Sylius/SyliusRector. You can add rules or rule sets to your <project_root>/rector.php
and reap benefits from Rector.
Installation pre Sylius-Standard 1.12
sylius/sylius-rector
package requires at least PHP 8.0. Of course, if you use PHP in version 7.4 you can use rector/rector
to upgrade your PHP version easily!
Then, when you meet the minimal requirements, run the following commands:
composer require sylius/sylius-rector --dev
Finally, create <project_root>/rector.php
file with the following content:
<?php declare(strict_types=1); use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; use Sylius\SyliusRector\Set\SyliusPlus; return static function (RectorConfig $rectorConfig): void { $rectorConfig->importNames(); $rectorConfig->import(__DIR__ . '/vendor/sylius/sylius-rector/config/config.php'); $rectorConfig->paths([ __DIR__ . '/src' ]); };
Learn Rector Faster
Rector is a tool that we develop and share for free, so anyone can save hundreds of hours on refactoring. But not everyone has time to understand Rector and AST complexity. You have 2 ways to speed this process up:
- read a book - The Power of Automated Refactoring
- hire our experienced team to improve your code base
Both ways support us to and improve Rector in sustainable way by learning from practical projects.
Thank you note
We would like to thank @alexander-schranz for starting this initiative and setting up initial codebase structure.