Skip to content

Commit 45ea324

Browse files
committed
chore(API-1925): Add rector dev dependency
1 parent f8695d2 commit 45ea324

File tree

4 files changed

+183
-33
lines changed

4 files changed

+183
-33
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ cs: ## Run code style check
3737
.PHONY: fix-cs
3838
fix-cs: ## Fix PHP code style
3939
$(DOCKER_RUN) bin/php-cs-fixer fix --config=.php_cs.php
40+
41+
.PHONY: rector
42+
rector: ## Run rector
43+
$(DOCKER_RUN) bin/rector

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"symfony/yaml": "^4.2",
3838
"donatj/mock-webserver": "^2.0",
3939
"http-interop/http-factory-guzzle": "^1.0",
40-
"php-http/guzzle6-adapter": "^2.0"
40+
"php-http/guzzle6-adapter": "^2.0",
41+
"rector/rector": "^0.14.6"
4142
},
4243
"config": {
4344
"bin-dir": "bin",

composer.lock

Lines changed: 149 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rector.php

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

0 commit comments

Comments
 (0)