Welcome to mirror list, hosted at ThFree Co, Russian Federation.

rector.php - github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1a9c94b39ca788f2f493183544a82e1be1b74e78 (plain)
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

declare(strict_types=1);

use PhpParser\Node\Scalar\EncapsedStringPart;
use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector;
use Rector\CodingStyle\Rector\FuncCall\VersionCompareFuncCallToConstantRector;
use Rector\CodingStyle\Rector\Property\AddFalseDefaultToBoolPropertyRector;
use Rector\CodingStyle\Rector\Switch_\BinarySwitchToIfElseRector;
use Rector\Core\Configuration\Option;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector;
use Rector\Set\ValueObject\SetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
    $parameters = $containerConfigurator->parameters();

    $parameters->set(Option::AUTO_IMPORT_NAMES, true);

    $parameters->set(Option::SETS, [
        SetList::CODING_STYLE,
        SetList::ACTION_INJECTION_TO_CONSTRUCTOR_INJECTION,
        SetList::ARRAY_STR_FUNCTIONS_TO_STATIC_CALL,
        SetList::CODE_QUALITY,
        SetList::PHP_53,
        SetList::PHP_54,
        SetList::PHP_56,
        SetList::PHP_70,
        SetList::PHP_71,
        SetList::PHP_72,
         SetList::PHPUNIT_CODE_QUALITY,
        
    ]);
//  

    $parameters->set(Option::SKIP, [
        VersionCompareFuncCallToConstantRector::class=>[  __DIR__ . '/src',],

        BinarySwitchToIfElseRector::class=>[  __DIR__ . '/src',],
        StaticCallOnNonStaticToInstanceCallRector::class=>[
            __DIR__ . '/src',
        ],
        AddFalseDefaultToBoolPropertyRector::class  => [
            // single file
            __DIR__ . '/src/classes/Connection.php',
            // or directory
            __DIR__ . '/src/database/databasetraits/HasTrait.php'
            
        ] 
    ]);
    $parameters->set(Option::PHPSTAN_FOR_RECTOR_PATH, __DIR__ . '/phpstan.neon');
    $parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_72);
    $parameters->set(Option::ENABLE_CACHE, true);
    $parameters->set(Option::CACHE_DIR, __DIR__ . '/.build/rector');
    $parameters->set(Option::PATHS, [
        __DIR__ . '/src/classes',
        __DIR__ . '/src/controllers',
        //__DIR__ . '/src/database',
        //__DIR__ . '/src/decorators',
        //__DIR__ . '/src/middleware',
        //__DIR__ . '/src/traits',
         //__DIR__ . '/tests'
         ]);
 
        // register single rule
        $services = $containerConfigurator->services();
        $services->set(EncapsedStringsToSprintfRector::class);
};