forked from mongodb/mongo-php-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rector.php
33 lines (28 loc) · 1.06 KB
/
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
29
30
31
32
33
<?php
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\ClassLike\RemoveAnnotationRector;
use Rector\Php70\Rector\StmtsAwareInterface\IfIssetToCoalescingRector;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Set\ValueObject\LevelSetList;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/examples',
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/tools',
]);
// Modernize code
$rectorConfig->sets([LevelSetList::UP_TO_PHP_74]);
// phpcs:disable Squiz.Arrays.ArrayDeclaration.KeySpecified
$rectorConfig->skip([
// Do not use ternaries extensively
IfIssetToCoalescingRector::class,
// Not necessary in documentation examples
JsonThrowOnErrorRector::class => [
__DIR__ . '/tests/DocumentationExamplesTest.php',
],
]);
// phpcs:enable
// All classes are public API by default, unless marked with @internal.
$rectorConfig->ruleWithConfiguration(RemoveAnnotationRector::class, ['api']);
};