forked from rectorphp/rector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
php74.php
65 lines (47 loc) · 2.58 KB
/
php74.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
declare(strict_types=1);
use Rector\Php74\Rector\Assign\NullCoalescingOperatorRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
use Rector\Php74\Rector\Double\RealToFloatTypeCastRector;
use Rector\Php74\Rector\FuncCall\ArrayKeyExistsOnPropertyRector;
use Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector;
use Rector\Php74\Rector\FuncCall\FilterVarToAddSlashesRector;
use Rector\Php74\Rector\FuncCall\GetCalledClassToStaticClassRector;
use Rector\Php74\Rector\FuncCall\MbStrrposEncodingArgumentPositionRector;
use Rector\Php74\Rector\Function_\ReservedFnFunctionRector;
use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
use Rector\Php74\Rector\MethodCall\ChangeReflectionTypeToStringToGetNameRector;
use Rector\Php74\Rector\Property\RestoreDefaultNullToNullableTypePropertyRector;
use Rector\Php74\Rector\Property\TypedPropertyRector;
use Rector\Php74\Rector\StaticCall\ExportToReflectionFunctionRector;
use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(TypedPropertyRector::class);
$services->set(RenameFunctionRector::class)
->call('configure', [[
RenameFunctionRector::OLD_FUNCTION_TO_NEW_FUNCTION => [
#the_real_type
# https://wiki.php.net/rfc/deprecations_php_7_4
'is_real' => 'is_float',
#apache_request_headers_function
# https://wiki.php.net/rfc/deprecations_php_7_4
'apache_request_headers' => 'getallheaders',
//'hebrevc' => ['nl2br', 'hebrev'],
],
]]);
$services->set(ArrayKeyExistsOnPropertyRector::class);
$services->set(FilterVarToAddSlashesRector::class);
$services->set(ExportToReflectionFunctionRector::class);
$services->set(GetCalledClassToStaticClassRector::class);
$services->set(MbStrrposEncodingArgumentPositionRector::class);
$services->set(RealToFloatTypeCastRector::class);
$services->set(NullCoalescingOperatorRector::class);
$services->set(ReservedFnFunctionRector::class);
$services->set(ClosureToArrowFunctionRector::class);
$services->set(ArraySpreadInsteadOfArrayMergeRector::class);
$services->set(AddLiteralSeparatorToNumberRector::class);
$services->set(ChangeReflectionTypeToStringToGetNameRector::class);
$services->set(RestoreDefaultNullToNullableTypePropertyRector::class);
};