Skip to content

Commit 720d80a

Browse files
committed
Added rector
1 parent 79794b3 commit 720d80a

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
!/composer.json
1111
!/phpstan.neon
1212
!/README.md
13+
!/rector.php
1314
!/tests.xml

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"require-dev": {
1818
"phpunit/phpunit": ">= 6.0",
1919
"phpstan/phpstan": ">= 0.1",
20-
"jetbrains/phpstorm-attributes": "^1.0"
20+
"jetbrains/phpstorm-attributes": "^1.0",
21+
"rector/rector": "^0.18.13"
2122
},
2223
"autoload": {
2324
"psr-4": {

rector.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
6+
use Rector\Config\RectorConfig;
7+
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector;
8+
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
9+
use Rector\Set\ValueObject\LevelSetList;
10+
11+
return static function (RectorConfig $rectorConfig): void {
12+
$rectorConfig->paths([
13+
__DIR__ . '/src',
14+
__DIR__ . '/tests',
15+
]);
16+
17+
// register a single rule
18+
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
19+
20+
$rectorConfig->skip([RemoveUselessParamTagRector::class]);
21+
$rectorConfig->skip([MixedTypeRector::class]);
22+
23+
// define sets of rules
24+
$rectorConfig->sets([
25+
LevelSetList::UP_TO_PHP_80
26+
]);
27+
};

0 commit comments

Comments
 (0)