forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
69 lines (65 loc) · 2.22 KB
/
rector.php
File metadata and controls
69 lines (65 loc) · 2.22 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
# https://getrector.com/documentation
declare(strict_types=1);
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector;
use Rector\CodingStyle\Rector\FuncCall\CallUserFuncArrayToVariadicRector;
use OpenEMR\Rector\Rules\CatchExceptionToThrowableRector;
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\ValueObject\PhpVersion;
return RectorConfig::configure()
->withBootstrapFiles([
__DIR__ . '/rector-bootstrap.php',
])
->withPaths([
__DIR__ . '/Documentation',
__DIR__ . '/apis',
__DIR__ . '/ccdaservice',
__DIR__ . '/ccr',
__DIR__ . '/contrib',
__DIR__ . '/controllers',
__DIR__ . '/custom',
__DIR__ . '/gacl',
__DIR__ . '/interface',
__DIR__ . '/library',
__DIR__ . '/modules',
__DIR__ . '/oauth2',
__DIR__ . '/portal',
__DIR__ . '/sites',
__DIR__ . '/sphere',
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withCache(
// ensure file system caching is used instead of in-memory
cacheClass: FileCacheStorage::class,
// specify a path that works locally as well as on CI job runners
cacheDirectory: '/tmp/rector'
)
->withCodeQualityLevel(5)
->withConfiguredRule(ClassPropertyAssignToConstructorPromotionRector::class, [
'allow_model_based_classes' => true,
'inline_public' => false,
'rename_property' => true,
])
->withDeadCodeLevel(5)
// https://getrector.com/documentation/troubleshooting-parallel
->withParallel(
timeoutSeconds: 120,
maxNumberOfProcess: 12,
jobSize: 12
)
// FIXME rector should pick the php version from composer.json
// but that doesn't seem to be working, so hard-coding for now.
->withPhpVersion(PhpVersion::PHP_82)
->withRules([
CallUserFuncArrayToVariadicRector::class,
CatchExceptionToThrowableRector::class,
SimplifyIfElseToTernaryRector::class,
])
->withPhpSets()
->withSkip([
__DIR__ . '/sites/default/documents/smarty'
])
->withTypeCoverageLevel(5);