Skip to content

Commit 3c63914

Browse files
committed
Update Rector configuration
1 parent edc8109 commit 3c63914

2 files changed

Lines changed: 16 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
- Update to PHP 8.5
55
- Migrate tests from Pest PHP v2 to PHPUnit 11
66
- Remove deprecated code
7+
- Update PHPStan version 2
8+
- Update Rector version 2
79

810
## 1.1.0 - 2024-06-13
911
- Add the Arr `set()` method supports 'dot' (or custom) notation for nested arrays for setting nested values, for example, `$arr`->set('first-level.second-level.third-level', "something")`

rector.php

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,19 @@
22

33
declare(strict_types=1);
44

5-
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
65
use Rector\Config\RectorConfig;
7-
use Rector\Set\ValueObject\LevelSetList;
8-
use Rector\Set\ValueObject\SetList;
96

10-
return static function (RectorConfig $rectorConfig): void {
11-
$rectorConfig->paths([
12-
__DIR__ . '/examples',
13-
__DIR__ . '/src',
14-
__DIR__ . '/tests',
15-
]);
16-
17-
// register a single rule
18-
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
19-
20-
// define sets of rules
21-
$rectorConfig->sets([
22-
LevelSetList::UP_TO_PHP_81,
23-
SetList::DEAD_CODE,
24-
SetList::CODE_QUALITY,
25-
SetList::EARLY_RETURN,
26-
SetList::TYPE_DECLARATION,
27-
SetList::PRIVATIZATION
28-
]);
29-
};
7+
return RectorConfig::configure()
8+
->withPaths([
9+
__DIR__ . "/examples",
10+
__DIR__ . "/src",
11+
__DIR__ . "/tests",
12+
])
13+
->withPhpSets(php82: true)
14+
->withPreparedSets(
15+
deadCode: true,
16+
codeQuality: true,
17+
earlyReturn: true,
18+
typeDeclarations: true,
19+
privatization: true,
20+
);

0 commit comments

Comments
 (0)