Skip to content

Commit d5f9216

Browse files
Upgrade to PHPParser 5 and PHPStan 2 (#6431)
* Upgrade to PHPParser 5 and PHPStan 2 * patch finally stmt * patch function stmt * patch do stmt * patch catch stmt * patch trycatch stmt * patch for stmt * patch classmethod stmt * patch else stmt * patch while stmt * patch foreach stmt * patch case stmt * patch case stmt * patch elseif stmt * patch namespace stmt * patch node traverser stmt * regenerate preload * fix build preload generator * trigger patch * fix override param method pExpr_ArrowFunction * fix override param method pExpr_Ternary * fix override param method pExpr_Yield * fix override param method p * update parameters of RichParser * Fix IsSuperTypeOfResult usage on ShortenedObjectType * disable temporary phpstan extension config * use ParserFactory::createForVersion() * upgrade to phpstan/phpdoc-parser 2.0 * register ParserConfig as service * set lines and indexes config * remove ltrim on FileProcessor, PhpParser printformat preserving no longer ltrim * remove ltrim on FileProcessor, PhpParser printformat preserving no longer ltrim * Fix PhpDocTypeMapperTest * make PrettyPrinter.php higher priority than PrettyPrinterAbstract.php * add ConstantArrayTypeMapper * Fix native return type on non native call detection * use parent default indent parameter on pFileWithoutNamespace * override pExpr_ArrowFunction method * remove override pModifiers * fix CallableTypeNode parameter construct * fix ParamTagValueNode construct parameter * fix use Token as array on CommonNotEqualRector * ConstantArrayType is sub of root PHPStan type * fix cannot set null of node on PhpDocNodeTraverser * fix use Token as array on VariableInStringInterpolationFixerRector * fix use Token as array on CompleteMissingIfElseBracketRector * fix IsSuperTypeOfResult usage on ShortenedGenericObjectType * fix pArray() override parameters * Fix InstalledPackageResolverTest * temporary remove --error-format symplify as phpstan symplify rules temporary disabled * fix SmartPhpParserFactory setup * fix compatible phpstan 2.0.1 on build * Fix Throw_ from Expr on ThrowWithPreviousExceptionRector * fix ConstantArrayType usage on ArraySpreadInsteadOfArrayMergeRector * fix use Throw_ on Expr on TerminatedNodeAnalyzer * clean up prop * fix pass ArrayItem on Foreach_ * fix ArrayItem instance * Fix ClosureUse from Node on CallUserFuncWithArrowFunctionToInlineRector * Fix union normalize of float, string, integer * Fix union normalize of float, string, integer * remove return by ref param, no longer supported on phpstan 2 * Fix use of DeclareDeclare to DeclareItem on DeclareStrictTypesRector and IncreaseDeclareStrictTypesRector * fix replace PropertyProperty to PropertyItem * fix deprecated traverse constant * fix removed FunctionVariantWithPhpDocs over ExtendedFunctionVariant * fix use ExtendedNativeParameterReflection over NativeParameterWithPhpDocsReflection * replace PropertyProperty with PropertyItem * fix namespacedName init on ClassDependencyManipulatorTest * Fix Throw_ on expr on RemoveAlwaysElseRector * fix PropertyItem over PropertyProperty on MissingPropertiesFactory * fix replace traverser on docs * Fix Throw_ stmt to Expr Throw on ChangeSwitchToMatchRector * fix Throw_ from expr on SwitchExprsResolver * fix next throw to use Expression with Throw_ as expr on MatchSwitchAnalyzer * fix sort MatchArm conds * fix magic __CLASS__ get value * fix use token as array on ParenthesizedNestedTernaryAnalyzer * [ci-review] Rector Rectify * replace deprecated class node to new node * [ci-review] Rector Rectify * fix test on FixtureJsonThrowCaseSensitiveConstFetch * Fix Throw_ from Expr on ConsecutiveNullCompareReturnsToNullCoalesceQueueRector * Fix Throw_ on SilentVoidResolver * fix node visitor stop * [ci-review] Rector Rectify * fix Throw_ on Expr * fix undefined ContantType * fix undefined ContantType * fix addVisitor() after call parent::construct() * fix check has Throw on AddNeverReturnType * [ci-review] Rector Rectify * fix check has Throw on AddNeverReturnType * fix test on JsonThrowCaseSensitiveConstFetchTest * fix arrow function text spacing * Fix ArrayItem resolve on normalize item value * prepare for doctrine value migration * setup doctrine * [ci-review] Rector Rectify * use PhpDocTagNode * clean up debug * fix ConstantArrayType * import * use createForNewestSupportedVersion * fix ConstantArrayType cast on RecastingRemovalRector * skip magic call on RecastingRemovalRector * fix use List_ node over Array_ on Foreach_ valueVar on UnusedForeachValueToArrayKeysRector * [ci-review] Rector Rectify * fix List_ on Foreach_ valueVar on PHPStanNodeScopeResolver * fix Array items always ArrayItem * skip instanceof check * skip instanceof check * fix mirror comment on StmtsManipulator * fix wrap heredoc print * fix return null next print on ExplicitReturnNullRector * fix print float/int override pScalar_int and pScalar_float * re-run rector * fix test with remove unused use on RenameClassRector test * fix ArrowFunction unnecessary parentheses * fix print in test for logical bool * fix binary op parentheses * fix on operator string + or - * fix on /, *, ** as well * add note for next todo binary op handling * fix pow opration with binary op parentheses handling * [ci-review] Rector Rectify * pull constant from NodeVisitor * only support php 7.4+ since phpstan 2 and php-parser 5 require php 7.4+ * downgrade to php 7.4 * remove php 7.2 e2e * use simple parser for defaultAnalysisParser, with native parser php 7.0 * Revert "use simple parser for defaultAnalysisParser, with native parser php 7.0" This reverts commit b3d6c45. * Fix parsing php 7 * fix Throw_ from Expr on AddOverrideAttributeToOverriddenMethodsRector * using inner try catch to ensure everything catched from root try * use constant from NodeVisitor * temporary handle later for doctrine, now focus on php-parser print * fix reprint cond on ParenthesizeNestedTernaryRector * PhpDocParser parent __construct() only have require 3 params now * disable native phpdoc-parser doctrine detection * Fix doctrine detection on ReadonlyPropertyRector * differentiate doctrine * later patch * fix InterpolatedStringPart detection for CreateFunctionToAnonymousFunctionRector on ValueResolver * print arrow function * print ArrowFunction on Carbon * fix set orig node on nested ternary on SwitchNegatedTernaryRector * Fix BinaryOp right origNode on CombineIfRector (part 1) * fix print on CombineIfRector (part 2) * Fix orig node set on ChangeNestedForeachIfsToEarlyContinueRector * [ci-review] Rector Rectify * fix set orig node on SimplifyIfReturnBoolRector * Add ReprintNodeVisitor, avoid add complexity to AbstractRector * fix reprint boolean not on SimplifyEmptyTest * fix right binary op * require --dev phpstan-phpunit 2 and phpstan-webmozart-assert 2 * ignore instanceof phpstanAPi.class notice * ignore instanceof phpstanApi.classConstant notice * ignore assert notice in test on purpose * php runtime check notice * set treatPhpDocTypesAsCertain: false * fix usage of ExtendedParametersAcceptor * ignore notice on provideMinPhpVersion() * ignore notice instanceof.alwaysTrue * fix List_ node usage on UnusedForeachValueToArrayKeysRector * ignore phpstanApi.constructor * ignore return.unusedType as follow parent signature * ignore varTag.nativeType as enforce native type * ignore phpstan notice: deadCode.unreachable as unreliable on runtime * fix always falsy on RemoveAlwaysElseRector * ignore argumet.type and return.type identifier * fix use Token as array on File value object * fix invalid ConstantScalar type usage on ValueResolver * ignore runtime comparison * fix empty array on TernaryToNullCoalescingRector * fix empty array on JsonThrowOnErrorRector * fix never null on RemoveDeadIfForeachForRector * fix useless array_values() on OverridenExistingNamesResolver * fix variable assign * fix ArrayType on TypeNormalizer * ignore phpstanApi.varTagAssumption * fix phpdoc parse error * fix isClassString() usage * fix phpstan notice * fix * fix intersection * reprint fix * fallback scope * fallback scope * [ci-review] Rector Rectify * fix phpstan * fix phpstan ArrayItem * [ci-review] Rector Rectify * First step of Doctrine works: detect doctrine class from use statement via ObjectTypeSpecifier service * fix phpstan * [ci-review] Rector Rectify * Fix alias object detection * Fix alias object detection * fix skip nette presenter * no need class exists check on fqcn * fix * fix doctrine rename on RenameClassRectorTest * add JoinColumns stubs * add InverseJoinColumn stubs * Fix named arg on NamedArgsFactory on ArrayItem * [ci-review] Rector Rectify * fix shortened object from use * Fix ClassConstFetch as key on AttributeArrayNameInliner * [ci-review] Rector Rectify * fix numeric value in attribute * fix auto import doctrine * handle numeric int as key * [ci-review] Rector Rectify * fix CurlylistNode usage on AnnotationToAttributeRector * [ci-review] Rector Rectify * fix nested attribute group apply * Fix inline array * Fix inline array * Fix printing generic * fix printing generic * add UniqueEntity stub * fix from use statement * remove unused stub * Fix multiline values * Fix multiline values * fix phpstan * fix requirement as php 7.4 * fix process single quoted * [ci-review] Rector Rectify * fix multi line * fix with description * use php 7.4 for linter * temporary update fixture to avoid crash single quote, due to phpstan-phpdoc-parser internal error * finally, unit test green * Coalesce print * fix interpolat print * [ci-review] Rector Rectify * patch ArrayItem usge on NodeFactory::createArgs() * doc indent check * handle doc indentation * [ci-review] Rector Rectify * require-dev phpstan/phpstan-deprecation-rules and fix deprecated method call * fix variable on full_build.sh * fix phsptan message return * Conditionally to not require rector/rector-src on PR 6431 for packages tests CI * final touch: enable return.type identifier phpstan * really final touch: comment * final touch: clean up always true check * final touch: clean up ignore config * really really final touch: clean up staticMethod.alreadyNarrowedType notice --------- Co-authored-by: GitHub Action <[email protected]>
1 parent cb76a5f commit d5f9216

File tree

327 files changed

+1647
-1179
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

327 files changed

+1647
-1179
lines changed

.github/workflows/build_scoped_rector.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ jobs:
6666
# 3. prefix classes
6767
- run: sh build/build-rector-scoped.sh rector-build rector-prefixed-downgraded
6868

69-
# 4. lint the code for PHP 7.2 - this must happen here, as setup-php allows only one PHP version switch: https://github.com/shivammathur/setup-php/issues/434
69+
# 4. lint the code for PHP 7.4 - this must happen here, as setup-php allows only one PHP version switch: https://github.com/shivammathur/setup-php/issues/434
7070
-
7171
uses: shivammathur/setup-php@v2
7272
with:
73-
php-version: 7.2
73+
php-version: 7.4
7474
coverage: none
7575
- run: composer global require php-parallel-lint/php-parallel-lint --ansi
7676
- run: /home/runner/.composer/vendor/bin/parallel-lint rector-prefixed-downgraded --exclude rector-prefixed-downgraded/stubs --exclude rector-prefixed-downgraded/vendor/tracy/tracy/examples --exclude rector-prefixed-downgraded/vendor/rector/rector-generator/templates --exclude rector-prefixed-downgraded/vendor/symfony/console/Debug/CliRequest.php

.github/workflows/code_analysis.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
-
2929
name: 'PHPStan'
30-
run: vendor/bin/phpstan analyse --ansi --error-format symplify
30+
run: vendor/bin/phpstan analyse --ansi
3131

3232
-
3333
name: 'Commented Code'

.github/workflows/packages_tests.yaml

+13-4
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,19 @@ jobs:
5050

5151
- run: composer config minimum-stability dev
5252

53-
# test with current commit in a pull-request
54-
-
55-
run: composer require rector/rector-src dev-main#${{github.event.pull_request.head.sha}} --no-update
56-
if: ${{ github.event_name == 'pull_request' }}
53+
# temporary for PR 6431 as rector/rector-* packages already require this PR branch
54+
# so avoid pointed to rector-src main branch composer.json
55+
- name: Conditionally to not require rector/rector-src on PR 6431
56+
if: ${{ github.event_name == 'pull_request' }}
57+
run: |
58+
if [ "${{ github.event.pull_request.number }}" != "6431" ]; then
59+
composer require rector/rector-src dev-main#${{ github.event.pull_request.head.sha }} --no-update
60+
fi
61+
62+
# # test with current commit in a pull-request
63+
# -
64+
# run: composer require rector/rector-src dev-main#${{github.event.pull_request.head.sha}} --no-update
65+
# if: ${{ github.event_name == 'pull_request' }}
5766

5867
- run: composer install --ansi
5968

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Head to [`rectorphp/rector`](http://github.com/rectorphp/rector) for documentati
1111

1212
## Building `rectorphp/rector`
1313

14-
Code of this repository requires PHP 8. For `rector/rector` package the build downgrades code to PHP 7.2+.
14+
Code of this repository requires PHP 8. For `rector/rector` package the build downgrades code to PHP 7.4+.
1515

1616
<br>
1717

build/build-preload.php

+27
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ final class PreloadBuilder
7676
'TokenEmulator.php',
7777
'KeywordEmulator.php',
7878
'Comment.php',
79+
'PrettyPrinter.php',
7980
'PrettyPrinterAbstract.php',
8081
'Parser.php',
8182
'ParserAbstract.php',
@@ -104,6 +105,21 @@ final class PreloadBuilder
104105
'TypeNode.php',
105106
];
106107

108+
/**
109+
* The classes are deprecated and moved under Node
110+
*
111+
* @var string[]
112+
*/
113+
private const IN_USE_CLASS_FILES = [
114+
'Node/Expr/ArrayItem.php',
115+
'Node/Expr/ClosureUse.php',
116+
'Node/Scalar/EncapsedStringPart.php',
117+
'Node/Scalar/LNumber.php',
118+
'Node/Stmt/DeclareDeclare.php',
119+
'Node/Stmt/PropertyProperty.php',
120+
'Node/Stmt/StaticVar.php',
121+
];
122+
107123
public function buildPreloadScript(string $buildDirectory, string $preloadFile): void
108124
{
109125
$this->buildPreloadScriptPhpParser($buildDirectory, $preloadFile);
@@ -315,6 +331,17 @@ private function findPhpParserFilesAndSortThem(string $vendorDir): array
315331
// 2. put first-class usages first
316332
$fileInfos = $this->sortFileInfos($fileInfos);
317333

334+
foreach ($fileInfos as $key => $fileInfo) {
335+
foreach (self::IN_USE_CLASS_FILES as $inUseClassFile) {
336+
if (str_ends_with($fileInfo->getPathname(), $inUseClassFile)) {
337+
unset($fileInfos[$key]);
338+
continue 2;
339+
}
340+
}
341+
}
342+
343+
$fileInfos = array_values($fileInfos);
344+
318345
$stmtsAwareInterface = new SplFileInfo(__DIR__ . '/../src/Contract/PhpParser/Node/StmtsAwareInterface.php');
319346
array_splice($fileInfos, 1, 0, [$stmtsAwareInterface]);
320347

build/config/config-downgrade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
return RectorConfig::configure()
1010
->withSkip(DowngradeRectorConfig::DEPENDENCY_EXCLUDE_PATHS)
1111
->withPHPStanConfigs([__DIR__ . '/phpstan-for-downgrade.neon'])
12-
->withDowngradeSets(php72: true);
12+
->withDowngradeSets(php74: true);
1313

1414
/**
1515
* Configuration consts for the different rector.php config files

build/config/phpstan-for-downgrade.neon

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,3 @@ parameters:
55
scanDirectories:
66
# this is needed for symfony/dependendency-injection as it has hidden dependency on symfony/expression-language that we don't use here
77
- ../../stubs
8-
9-
# see https://github.com/rectorphp/rector/issues/3490#issue-634342324
10-
featureToggles:
11-
disableRuntimeReflectionProvider: true

build/target-repository/.github/workflows/along_other_packages.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php_version: ['7.2', '7.3', '7.4', '8.0', '8.1']
16+
php_version: ['7.4', '8.0', '8.1']
1717
commands:
1818
-
1919
name: 'Composer Dependency'

build/target-repository/.github/workflows/e2e.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php_version: ['7.2', '7.3', '7.4', '8.0', '8.1']
17+
php_version: ['7.4', '8.0', '8.1']
1818
directory:
1919
- 'e2e/define-constant'
2020
- 'e2e/dont-execute-code'

build/target-repository/.github/workflows/e2e_diff.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php_version: ['7.2', '7.3', '7.4', '8.0', '8.1']
17+
php_version: ['7.4', '8.0', '8.1']
1818
directory:
1919
- 'e2e/attributes'
2020

build/target-repository/.github/workflows/e2e_global.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
php_version: ['7.2', '7.3', '7.4', '8.0', '8.1']
14+
php_version: ['7.4', '8.0', '8.1']
1515
directory:
1616
- 'e2e/global-install'
1717

build/target-repository/.github/workflows/e2e_php72.yaml

-31
This file was deleted.

build/target-repository/.github/workflows/standalone_rule_test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
php_version: ['7.3']
14+
php_version: ['7.4']
1515
directory:
1616
- 'e2e/rector-prefixed-rule-test'
1717

build/target-repository/composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"bin/rector"
88
],
99
"require": {
10-
"php": "^7.2|^8.0",
11-
"phpstan/phpstan": "^1.12.5"
10+
"php": "^7.4|^8.0",
11+
"phpstan/phpstan": "^2.0.1"
1212
},
1313
"autoload": {
1414
"files": [

build/target-repository/e2e/reflection-union-php72/composer.json

-11
This file was deleted.

build/target-repository/e2e/reflection-union-php72/rector.php

-17
This file was deleted.

build/target-repository/e2e/reflection-union-php72/src/foo.php

-14
This file was deleted.

composer.json

+23-27
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
"doctrine/inflector": "^2.0.10",
2121
"illuminate/container": "^11.25",
2222
"nette/utils": "^4.0",
23-
"nikic/php-parser": "^4.19.4",
23+
"nikic/php-parser": "^5.3.1",
2424
"ocramius/package-versions": "^2.9",
2525
"ondram/ci-detector": "^4.2",
26-
"phpstan/phpdoc-parser": "^1.32",
27-
"phpstan/phpstan": "^1.12.5",
26+
"phpstan/phpdoc-parser": "^2.0",
27+
"phpstan/phpstan": "^2.0.1",
2828
"react/event-loop": "^1.5",
2929
"react/promise": "^3.2",
3030
"react/socket": "^1.15",
@@ -45,21 +45,17 @@
4545
"require-dev": {
4646
"php-parallel-lint/php-parallel-lint": "^1.4",
4747
"phpstan/extension-installer": "^1.4",
48-
"phpstan/phpstan-deprecation-rules": "^1.2",
49-
"phpstan/phpstan-phpunit": "^1.4",
50-
"phpstan/phpstan-webmozart-assert": "^1.2.6",
48+
"phpstan/phpstan-deprecation-rules": "^2.0",
49+
"phpstan/phpstan-phpunit": "^2.0",
50+
"phpstan/phpstan-webmozart-assert": "^2.0",
5151
"phpunit/phpunit": "^10.5",
5252
"rector/release-notes-generator": "^0.3.0",
5353
"rector/swiss-knife": "^0.2.16",
54-
"rector/type-perfect": "^1.0",
5554
"shipmonk/composer-dependency-analyser": "^1.8",
5655
"symplify/easy-coding-standard": "^12.3",
57-
"symplify/phpstan-extensions": "^11.4",
58-
"symplify/phpstan-rules": "^13.0",
5956
"symplify/rule-doc-generator": "^12.2.5",
6057
"symplify/vendor-patches": "^11.3",
6158
"tomasvotruba/class-leak": "^1.1.2",
62-
"tomasvotruba/unused-public": "^1.0",
6359
"tracy/tracy": "^2.9"
6460
},
6561
"replace": {
@@ -111,7 +107,7 @@
111107
],
112108
"check-cs": "vendor/bin/ecs check --ansi",
113109
"fix-cs": "vendor/bin/ecs check --fix --ansi",
114-
"phpstan": "vendor/bin/phpstan analyse --ansi --error-format symplify --memory-limit=512M",
110+
"phpstan": "vendor/bin/phpstan analyse --ansi --memory-limit=512M",
115111
"docs": "vendor/bin/rule-doc-generator validate rules",
116112
"rector": "bin/rector process --ansi",
117113
"preload": "php build/build-preload.php .",
@@ -126,22 +122,22 @@
126122
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/illuminate-container-container-php.patch"
127123
],
128124
"nikic/php-parser": [
129-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-expr-closure-php.patch",
130-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-finally-php.patch",
131-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-function-php.patch",
132-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-do-php.patch",
133-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-catch-php.patch",
134-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-trycatch-php.patch",
135-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-for-php.patch",
136-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-classmethod-php.patch",
137-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-else-php.patch",
138-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-while-php.patch",
139-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-foreach-php.patch",
140-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-if-php.patch",
141-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-case-php.patch",
142-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-elseif-php.patch",
143-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-node-stmt-namespace-php.patch",
144-
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/nikic-php-parser-lib-phpparser-nodetraverser-php.patch"
125+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-expr-closure-php.patch",
126+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-finally-php.patch",
127+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-function-php.patch",
128+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-do-php.patch",
129+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-catch-php.patch",
130+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-trycatch-php.patch",
131+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-for-php.patch",
132+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-classmethod-php.patch",
133+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-else-php.patch",
134+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-while-php.patch",
135+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-foreach-php.patch",
136+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-if-php.patch",
137+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-case-php.patch",
138+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-elseif-php.patch",
139+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-node-stmt-namespace-php.patch",
140+
"https://raw.githubusercontent.com/rectorphp/vendor-patches/php-parser-5-latest/patches/nikic-php-parser-lib-phpparser-nodetraverser-php.patch"
145141
]
146142
},
147143
"composer-exit-on-patch-failure": true,

config/phpstan/parser.neon

-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ services:
2424
class: PHPStan\Parser\RichParser
2525
arguments:
2626
parser: @currentPhpVersionPhpParser
27-
lexer: @currentPhpVersionLexer
2827
autowired: no

config/phpstan/static-reflection.neon

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
parameters:
2-
# see https://github.com/rectorphp/rector/issues/3490#issue-634342324
3-
featureToggles:
4-
disableRuntimeReflectionProvider: false
5-
nodeConnectingVisitorCompatibility: false
6-
71
services:
82
- Rector\NodeTypeResolver\Reflection\BetterReflection\RectorBetterReflectionSourceLocatorFactory
93
- Rector\NodeTypeResolver\Reflection\BetterReflection\SourceLocator\IntermediateSourceLocator

full_build.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# usage:
44
#
5-
# export PHP72_BIN_PATH=/opt/local/bin/php72 && sh ./full_build.sh
5+
# export PHP74_BIN_PATH=/opt/local/bin/php74 && sh ./full_build.sh
66

77
# see https://stackoverflow.com/questions/66644233/how-to-propagate-colors-from-bash-script-to-github-action?noredirect=1#comment117811853_66644233
88
export TERM=xterm-color
@@ -37,14 +37,14 @@ php -d memory_limit=-1 bin/rector process rector-build/bin rector-build/config r
3737

3838
sh build/build-rector-scoped.sh rector-build rector-prefixed-downgraded
3939

40-
# verify syntax valid in php 7.2
40+
# verify syntax valid in php 7.4
4141
composer global require php-parallel-lint/php-parallel-lint
4242

43-
if test -z ${PHP72_BIN_PATH+y}; then
43+
if test -z ${PHP74_BIN_PATH+y}; then
4444
~/.config/composer/vendor/bin/parallel-lint rector-prefixed-downgraded --exclude rector-prefixed-downgraded/stubs --exclude rector-prefixed-downgraded/vendor/tracy/tracy/examples --exclude rector-prefixed-downgraded/vendor/rector/rector-generator/templates --exclude rector-prefixed-downgraded/vendor/symfony/console/Debug/CliRequest.php
4545
else
46-
echo "verify syntax valid in php 7.2 with specify PHP72_BIN_PATH env";
47-
$PHP72_BIN_PATH ~/.composer/vendor/bin/parallel-lint rector-prefixed-downgraded --exclude rector-prefixed-downgraded/stubs --exclude rector-prefixed-downgraded/vendor/tracy/tracy/examples --exclude rector-prefixed-downgraded/vendor/rector/rector-generator/templates --exclude rector-prefixed-downgraded/vendor/symfony/console/Debug/CliRequest.php
46+
echo "verify syntax valid in php 7.4 with specify PHP74_BIN_PATH env";
47+
$PHP74_BIN_PATH ~/.composer/vendor/bin/parallel-lint rector-prefixed-downgraded --exclude rector-prefixed-downgraded/stubs --exclude rector-prefixed-downgraded/vendor/tracy/tracy/examples --exclude rector-prefixed-downgraded/vendor/rector/rector-generator/templates --exclude rector-prefixed-downgraded/vendor/symfony/console/Debug/CliRequest.php
4848
fi
4949

5050
# rollback, done testing succeed

0 commit comments

Comments
 (0)