Commit Graph

14463 Commits

Author SHA1 Message Date
Abdul Malik Ikhsan
a9c6d9bd06
[Core][DeadCode] Remove ClassMethodManipulator->isPropertyPromotion() (#2346) 2022-05-22 18:59:41 +02:00
Abdul Malik Ikhsan
8fbc6582f9
[Core][Naming] Move collecting param names method to FunctionLikeManipulator (#2347)
* [Core][Naming] Move collecting param names method to FunctionLikeManipulator

* use getParams() as interface

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2022-05-22 18:53:13 +02:00
Abdul Malik Ikhsan
68906c7e17
[DeadCode] Skip used in compact() on RemoveUnusedConstructorParamRector (#2345)
* [DeadCode] Skip used in compact() on RemoveUnusedConstructorParamRector

* Fixed 🎉

* phpstan

* phpstan

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2022-05-22 13:42:14 +02:00
Tomas Votruba
20731aedd2 add RectorConfigProvider::getSymfonyContainerXml() 2022-05-22 09:42:53 +02:00
Ruud Kamphuis
a59e9cece6
Fix return type of FileInfoParser::parseFileInfoToNodesAndDecorate (#2344)
It returns `PhpParser\Node\Stmt[]` instead of `PhpParser\Node[]`.
2022-05-22 14:17:58 +07:00
Tomas Votruba
08a35afeb1 remove symfony routes json paramter as unused 2022-05-22 09:12:04 +02:00
Tomas Votruba
adb6e68c2a
[automated] Re-Generate Nodes/Rectors Documentation (#2343)
Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com>
2022-05-22 00:30:58 +00:00
Abdul Malik Ikhsan
fef1a03955
[DeadCode] Skip used in Closure use on RemoveUnusedConstructorParamRector (#2341) 2022-05-21 18:24:10 +02:00
Tomas Votruba
b4120a8850
[DX] Use direct method on node, instead of token position (#2340) 2022-05-21 08:43:58 +00:00
Tomas Votruba
fcadc67328
add symfony php config option to allow loading route factory (#2339) 2022-05-21 08:42:08 +00:00
Abdul Malik Ikhsan
36fd8fa619
[NodeTypeResolver] Remove DummyTraitClass check as the class no longer exists (#2338) 2022-05-20 19:59:01 +02:00
Abdul Malik Ikhsan
f0a1b688f3
[DowngradePhp80] Apply PHPStan 1.7.x-dev compatible for PhpParameterReflection (#2336) 2022-05-20 12:16:54 +02:00
Abdul Malik Ikhsan
1a56ec1736
[Php80] Handle default in previous not used in next switch (#2335)
* [Php80] Handle default in previous not used in next switch

* debug

* Fixed 🎉

* Fixed 🎉
2022-05-20 01:07:00 +07:00
Abdul Malik Ikhsan
3f0a0b7259
[Php80] Skip no default return fluent on ChangeSwitchToMatchRector (#2334) 2022-05-19 18:23:22 +02:00
Abdul Malik Ikhsan
f90acd4c3a
[DowngradePhp80] Handle inside Closure on DowngradeMatchToSwitchRector (#2333)
* [DowngradePhp80] Handle inside Closure on DowngradeMatchToSwitchRector

* Fixed 🎉

* CI tweak

* updated tests

* check parent structure

* verify original node

* clean up

* rollback

* run all tests with paratest
2022-05-19 21:25:28 +07:00
Abdul Malik Ikhsan
30a53bfd93
[DowngradePhp80] Add in arrow function in return support on DowngradeMatchToSwitchRector (#2331)
* [DowngradePhp80] Add in arrow function in return support on DowngradeMatchToSwitchRector

* Fixed 🎉

* [ci-review] Rector Rectify

* final touch: variable naming

* final touch: variable naming

* final touch: variable naming

* final touch: comment for future

* final touch: comment for future

* Fixed 🎉

* Fixed 🎉

* phpstan

* [ci-review] Rector Rectify

* fix test

Co-authored-by: GitHub Action <action@github.com>
2022-05-19 08:52:59 +02:00
Abdul Malik Ikhsan
36af81f0dd
[DowngradePhp80] Handle match inside ArrowFunction on DowngradeMatchToSwitchRector (#2330)
Co-authored-by: GitHub Action <action@github.com>
2022-05-18 17:19:35 +02:00
Abdul Malik Ikhsan
0704ba0af4
[Core] Remove clean comment on NodeComparator::isNodeEqual() (#2329) 2022-05-18 14:59:40 +02:00
Abdul Malik Ikhsan
e33bcf19be
[Core] Override pModifiers() method to set final and abstract modifiers early on BetterStandardPrinter (#2328)
Co-authored-by: GitHub Action <action@github.com>
2022-05-18 12:41:43 +02:00
Abdul Malik Ikhsan
2c0f802aaf
[DeadCode] Allow return Nop Stmts (comments) on RemoveAlwaysTrueIfConditionRector (#2327) 2022-05-18 10:07:35 +02:00
Abdul Malik Ikhsan
eeeba85f48
[Core] Improve PropertyFetchFinder to use PropertyFetchAnalyzer (#2326) 2022-05-18 09:37:54 +02:00
Abdul Malik Ikhsan
50943ea4f2
[CodeQuality] Skip re use variable in assign Expr on InlineArrayReturnAssignRector (#2325)
* [CodeQuality] Skip re use variable in assign Expr on InlineArrayReturnAssignRector

* Fixed 🎉

* [ci-review] Rector Rectify

* final touch: move check for reuse

* matchKeyOnArrayDimFetchOfVariable never reuse

Co-authored-by: GitHub Action <action@github.com>
2022-05-18 08:29:33 +07:00
Abdul Malik Ikhsan
15d93fa815
[DeadCode] Handle combine RemoveAlwaysTrueIfConditionRector + RemoveDeadConstructorRector (#2324) 2022-05-16 23:14:55 +02:00
Abdul Malik Ikhsan
7a08f1bbe5
[Core] Move $configuration->shouldShowProgressBar() before loop (#2323) 2022-05-16 11:35:42 +02:00
Abdul Malik Ikhsan
c0086b7e14
[e2e] Add e2e for tests removed node display applied rules with return null (#2320)
* [e2e] Add e2e for tests removed node display applied rules with return null

* update
2022-05-16 08:13:14 +07:00
Abdul Malik Ikhsan
91ffbbb74d
[Core] Direct assign visitors property data on RectorNodeTraverser (#2315)
* [Core] Direct assign visitors property data on RectorNodeTraverser

* keep safe

* fix
2022-05-15 20:14:20 +07:00
Abdul Malik Ikhsan
0686f438cc
[PHPStan] Enable symplify-rules.neon (#2318)
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
Co-authored-by: GitHub Action <action@github.com>
2022-05-15 11:44:09 +00:00
Abdul Malik Ikhsan
d61eea4aca
[Core] Ensure parent is Node on AbstractScopeAwareRector (#2317) 2022-05-15 12:24:33 +02:00
Abdul Malik Ikhsan
70f10c9c77
[Core] Fix message configure rule error on EmptyConfigurableRectorChecker (#2316) 2022-05-15 12:07:37 +02:00
Tomas Votruba
96400215b5
[automated] Re-Generate Nodes/Rectors Documentation (#2314)
* [automated] Re-Generate Nodes/Rectors Documentation

* use option 2

Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com>
Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
2022-05-15 09:35:22 +00:00
Abdul Malik Ikhsan
1d75b53e97
[Core] Add ScopeAnalyzer service to verify if Node is Scope aware (#2311)
* [Core] Add ScopeAnalyzer service to verify if Node is Scope aware

* cs

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* fix

* fix

* fix

* [ci-review] Rector Rectify

* fix

* [ci-review] Rector Rectify

* fix

* fix

* move comment

* fix

* fix

* fix

* fix

Co-authored-by: GitHub Action <action@github.com>
2022-05-14 13:25:29 +02:00
Abdul Malik Ikhsan
3ed69d7ecf
[CodeQuality] Apply StmtsAwareInterface node on SimplifyUselessVariableRector (#2310)
* [CodeQuality] Apply StmtsAwareInterface node on SimplifyUselessVariableRector

* implemented

* final touch: no need to continue when stmt is found, removal after return is handled on RemoveUnreachableStatementRector
2022-05-14 11:27:29 +02:00
Abdul Malik Ikhsan
fcb2dc6f33
[CodeQuality] Do not duplicate Expr on SimplifyIfElseToTernaryRector+SimplifyUselessVariableRector+CompleteDynamicPropertiesRector (#2308)
* [CodeQuality] Do not duplicate Expr on SimplifyIfElseToTernaryRector+SimplifyUselessVariableRector+CompleteDynamicPropertiesRector

* Fixed 🎉

* clen up
2022-05-14 09:32:02 +02:00
USAMI Kenta
f92d5deca3
Fix Scalar_Encapsed node as dynamic in ExprAnalyzer::isDynamicExpr() (#2309)
* Add test to skip interpolated string conversion

* Fix Scalar_Encapsed node as dynamic in ExprAnalyzer::isDynamicExpr()
2022-05-14 09:36:09 +07:00
Abdul Malik Ikhsan
26d2589aba
[Parallel] Fix --debug not working in parallel (#2307)
* [Parallel] Fix --debug not working in parallel

* Fix

* Fix

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2022-05-13 23:10:38 +07:00
Malte Schlüter
4d31934258
Add new rule to add annotations from router configuration to symfony controllers (#2306) 2022-05-13 12:08:27 +02:00
Tomas Votruba
28dc9cebb2
Prepare NamedToUnnamedArgs for PhpParameterReflection change in PHPStan 1.7 (#2305) 2022-05-13 11:21:30 +02:00
Tomas Votruba
1ec5e2d35b restore links 2022-05-12 21:13:03 +02:00
Tomas Votruba
52ea41240e restore regex replaces 2022-05-12 21:10:39 +02:00
Tomas Votruba
47bea33c2e use changelog annotations to display useful into under the change 2022-05-12 21:07:36 +02:00
Abdul Malik Ikhsan
f0d68c75a1
[Php82] Fixtures for skip combination writable + readonly on ReadOnlyClassRector (#2304)
* [Php82] Fixtures for skip combination writable + readonly on ReadOnlyClassRector

* more
2022-05-12 16:03:54 +00:00
Abdul Malik Ikhsan
78aaf7ee0b
[Php82] Add ReadOnlyClassRector (#2296)
* [Php82] Add ReadOnlyClassRector

* skip has non-readonly property

* note

* note

* note

* [ci-review] Rector Rectify

* skip has AllowDynamicProperties attribute

* skip already readonly

* [ci-review] Rector Rectify

* skip property promotion not readonly

* no params means no property promotion, skip if no property defined

* note

* note

* skip final class, possibly extendable

* add fixture

* add @see

* visibility union ndoe rules/Privatization/NodeManipulator/VisibilityManipulator.php

* visibility union ndoe rules/Privatization/NodeManipulator/VisibilityManipulator.php

* remove already readonly fixture

* comment

* skip anonymous class fixture

* skip non-final class fixture

* skip allow dynamic fixture

* class check

* skip has writable property fixture

* skip no properties

* skip property promotion writable

* debug

* [ci-review] Rector Rectify

* fix

* eol

* fix

* [ci-review] Rector Rectify

* final touch: add up-to-php82 level setlist

Co-authored-by: GitHub Action <action@github.com>
2022-05-12 22:44:59 +07:00
Tomas Votruba
93cf392561
Add [file] + [rule] debug info on --debug + fix literal number downgrade type change to string (#2302)
* exact attribute type

* add debug file + rule on --debug for easier output

* make DowngradeNumericLiteralSeparatorRector keep the type

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2022-05-12 16:27:28 +02:00
Abdul Malik Ikhsan
e88903f64e
[Core] Improve UnreachableStmtAnalyzer: verify itself by recursive call (#2300) 2022-05-12 12:20:20 +02:00
Tomas Votruba
33cd52e703
Fix position of class after non-reachable stmts (#2299)
* class cannot be under non-reachable stmts

* static fixes in bin/rector.php
2022-05-12 09:05:03 +00:00
Tomas Votruba
3bae3b9e75
[Downgrade] Separate multi level dependency in DowngradeArraySpreadRector (#2298) 2022-05-12 08:50:48 +00:00
Tomas Votruba
3d499125b8
Add Scope refresh for changed or new nodes (#2292) 2022-05-12 08:33:27 +02:00
Tomas Votruba
39e552c4c9
Various little improvement (#2297) 2022-05-12 08:07:50 +02:00
Abdul Malik Ikhsan
cd2a644e0c
[Core] Refactor RectifiedAnalyzer: early check against AbstractScopeAwareRector instead of Original node (#2295) 2022-05-12 07:14:00 +02:00
Tomas Votruba
2ccb53592e
Improve indent types (#2294) 2022-05-11 22:46:44 +00:00