Skip to content

Commit

Permalink
support: add rector
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Login <batazor111@gmail.com>
  • Loading branch information
batazor committed Jan 4, 2023
1 parent 9e584aa commit 8f8f342
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 3 deletions.
3 changes: 2 additions & 1 deletion internal/services/support/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This service implements the support services for our platform.
- **OPCache** is a PHP module that improves performance by storing precompiled script bytecode in shared memory.
- **Composer** is a dependency manager for PHP.

#### BDD
#### Best Practices

- [**Behat**](https://docs.behat.org/en/latest/index.html) is a PHP framework for BDD.
- rector is a tool to automatically upgrade and refactor PHP 5.3+ code.
3 changes: 2 additions & 1 deletion internal/services/support/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
}
],
"require-dev": {
"behat/behat": "^3.12"
"behat/behat": "^3.12",
"rector/rector": "^0.15.2"
}
}
117 changes: 116 additions & 1 deletion internal/services/support/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions internal/services/support/rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/features',
__DIR__ . '/src',
]);

// register a single rule
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);

// define sets of rules
// $rectorConfig->sets([
// LevelSetList::UP_TO_PHP_82
// ]);
};

0 comments on commit 8f8f342

Please sign in to comment.