forked from rectorphp/rector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
php73.php
51 lines (45 loc) · 2.26 KB
/
php73.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
declare(strict_types=1);
use Rector\Php52\Rector\Switch_\ContinueToBreakInSwitchRector;
use Rector\Php73\Rector\BooleanOr\IsCountableRector;
use Rector\Php73\Rector\ConstFetch\SensitiveConstantNameRector;
use Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector;
use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector;
use Rector\Php73\Rector\FuncCall\RegexDashEscapeRector;
use Rector\Php73\Rector\FuncCall\SensitiveDefineRector;
use Rector\Php73\Rector\FuncCall\StringifyStrNeedlesRector;
use Rector\Php73\Rector\String_\SensitiveHereNowDocRector;
use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(IsCountableRector::class);
$services->set(ArrayKeyFirstLastRector::class);
$services->set(SensitiveDefineRector::class);
$services->set(SensitiveConstantNameRector::class);
$services->set(SensitiveHereNowDocRector::class);
$services->set(RenameFunctionRector::class)
->call('configure', [[
RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [
# https://wiki.php.net/rfc/deprecations_php_7_3
'image2wbmp' => 'imagewbmp',
'mbregex_encoding' => 'mb_regex_encoding',
'mbereg' => 'mb_ereg',
'mberegi' => 'mb_eregi',
'mbereg_replace' => 'mb_ereg_replace',
'mberegi_replace' => 'mb_eregi_replace',
'mbsplit' => 'mb_split',
'mbereg_match' => 'mb_ereg_match',
'mbereg_search' => 'mb_ereg_search',
'mbereg_search_pos' => 'mb_ereg_search_pos',
'mbereg_search_regs' => 'mb_ereg_search_regs',
'mbereg_search_init' => 'mb_ereg_search_init',
'mbereg_search_getregs' => 'mb_ereg_search_getregs',
'mbereg_search_getpos' => 'mb_ereg_search_getpos',
],
]]);
$services->set(StringifyStrNeedlesRector::class);
$services->set(JsonThrowOnErrorRector::class);
$services->set(RegexDashEscapeRector::class);
$services->set(ContinueToBreakInSwitchRector::class);
};