-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrector.php
28 lines (22 loc) · 974 Bytes
/
rector.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php declare(strict_types = 1);
use Rector\Core\ValueObject\PhpVersion;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use Rector\Config\RectorConfig;
return static function (RectorConfig $rectorConfig): void {
// is your PHP version different from the one you refactor to? [default: your PHP version], uses PHP_VERSION_ID format
$rectorConfig->phpVersion(PhpVersion::PHP_74);
// Path to PHPStan with extensions, that PHPStan in Rector uses to determine types
//$rectorConfig->phpstanConfig(__DIR__ . '/build/PhpStan/phpstan.neon');
// paths to refactor; solid alternative to CLI arguments
$rectorConfig->paths([
__DIR__ . '/sources',
__DIR__ . '/tests',
]);
// define, what sets of rules will be applied
// tip: use "SetList" class to autocomplete sets
//$rectorConfig->sets([
// SetList::CODE_QUALITY
//]);
// register single rule
$rectorConfig->rule(TypedPropertyRector::class);
};