This commit is contained in:
ldestailleur 2025-09-18 15:41:47 +02:00
parent b30aa97ba9
commit 02ec4cf421
3 changed files with 18 additions and 5 deletions

View file

@ -28,8 +28,15 @@
<rule ref="Internal.NoCodeFound" />
<!-- Rules from Generic Standard -->
<!--
<rule ref="PSR12.Files.OpenTag">
<properties>
<property name="ignoreIndent" value="true"/>
</properties>
</rule>
<exclude name="PSR12.WhiteSpace.ScopeIndent"/>
-->
<!-- We want to allow empty statement: It allows to put some code comments into the else for examples -->
<rule ref="Generic.CodeAnalysis.EmptyStatement">

View file

@ -19,12 +19,12 @@ composer install
##### To make changes (remove --dry-run for real run)
```shell
cd dev/tools/rector
./vendor/bin/rector process --dry-run
./vendor/bin/rector process --debug --dry-run
```
##### To make changes on a given directory
```shell
cd dev/tools/rector
./vendor/bin/rector process [--dry-run] [--clear-cache] ../../../htdocs/core/
./vendor/bin/rector process --debug [--dry-run] [--clear-cache] ../../../htdocs/core/
```

View file

@ -33,7 +33,7 @@ use Rector\Set\ValueObject\SetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->phpVersion(PhpVersion::PHP_71);
//$rectorConfig->indent(' ', 4);
$rectorConfig->indent(' ', 4);
// Traits seems not supported correctly by rector without declaring them as bootstrapFiles
$arrayoftraitfiles = array(
@ -86,8 +86,14 @@ return static function (RectorConfig $rectorConfig): void {
// This fix <> into != but it breaks other rules, so added at end.
$rectorConfig->rule(Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class);
//$rectorConfig->rule(Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class);
/*
$rectorConfig->skip([
Rector\BetterPhpDocParser\PhpDocParser\BetterPhpDocParser::class,
Dolibarr\Rector\Renaming\GlobalToFunction::class
]);
*/
// Add all predefined rules to migrate to up to php 71.
// Warning this break tab spacing of arrays on several lines