Commit Graph

49 Commits

Author SHA1 Message Date
Tomas Votruba
3407066315
[DX] Replace global BetterStandardPrinter from AbstractRector with autowired NodePrinterInterface for easier and specific re-use (#2036)
Co-authored-by: GitHub Action <action@github.com>
2022-04-10 00:36:13 +02:00
Abdul Malik Ikhsan
2d3419bc94
[Arguments] Handle by pass 2nd argument default value on ArgumentAdderRector (#1946)
* [Arguments] Handle by pass 2nd argument on ArgumentAdderRector

* [Arguments] Handle by pass 2nd argument on ArgumentAdderRector

* Fixed 🎉
2022-03-18 14:06:06 +01:00
Tomas Votruba
84f7ebde04
Add StaticCall support to RemoveMethodCallParamRector (#1916) 2022-03-08 10:52:29 +01:00
Tomas Votruba
9660188944
[phpstan] Add known array keys types (#1909) 2022-03-07 12:45:26 +01:00
Tomas Votruba
3948d8b1d4
[Arguments] Add RemoveMethodCallParamRector (#1906) 2022-03-05 11:33:32 +00:00
Tomas Votruba
9f98873278
[DX] Remove deprecated constants (#1833) 2022-02-18 02:39:44 +01:00
Abdul Malik Ikhsan
cfd0d61b52
[CodingStyle] Trigger RemoveFinalFromConstRector (#1733)
* [CodingStyle] Trigger RemoveFinalFromConstRector

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2022-01-27 01:47:33 +07:00
Tomas Votruba
29838d0c0d
[Parallel] Process smaller chunk of files at once (#1587)
Co-authored-by: GitHub Action <action@github.com>
2021-12-28 14:53:11 +01:00
Tomas Votruba
fa31841d4d
[DX] Warn about deprecated constant configuration (#1444) 2021-12-10 00:10:20 +00:00
Tomas Votruba
af9ade2eea
[DX] Improve configuration objects + allow Symfony 6 (#1430) 2021-12-09 10:04:27 +01:00
Tomas Votruba
5493b6dc13
[DX] Re-use configure() in docs + remove prefixing of ValueObjectInliner (#1410) 2021-12-06 21:59:45 +01:00
Abdul Malik Ikhsan
eea8393cc4
[Rectify] [Php81] Enable Rectify for finalize public class constant only (#1380)
* up to php 8.0 with add FinalizePublicClassConstantRector

* temporary skip non finalize public class constant rector

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2021-12-04 15:35:50 +00:00
Abdul Malik Ikhsan
fc10fce13d
[Rectify] [Php81] Enable Rectify on Readonly Property only (#1384)
* re-enable rectify and ecs

* [Rectify] [Php81] Enable Rectify on Readonly Property only

* comment

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2021-12-04 15:32:52 +03:00
Tomas Votruba
185ee1b473
[DX] Add strict PHPStan rules - step #4 (#1333)
Co-authored-by: GitHub Action <action@github.com>
2021-11-28 18:48:56 +01:00
Tomas Votruba
6340d263f4
[DX] Add strict PHPStan rules - step #3 (#1331) 2021-11-28 18:19:45 +01:00
Tomas Votruba
39a530c1f5
[DX] Add strict PHPStan rules - step #2 (#1330) 2021-11-28 16:45:10 +00:00
Tomas Votruba
3844627c63
[DX] make all configure() methods accept direct value object configuration (#1322) 2021-11-27 13:26:22 +00:00
Tomas Votruba
c3b6efea7e
Move from CLASS_NODE attribute to more reliable parent node finder (#1162) 2021-11-06 12:52:18 +01:00
Tomas Votruba
830590cedb move TypeKind to enum namespace 2021-10-27 20:50:50 +02:00
Tomas Votruba
e71237334c strict types 2021-10-27 20:50:50 +02:00
Tomas Votruba
e060d008ba
Decopule helper template/mixin services from PHPStanNodeScopeResolver (#1067)
Co-authored-by: GitHub Action <action@github.com>
2021-10-26 11:07:47 +02:00
Tomas Votruba
fd72d08233
Extract ObjectReference enum for "self", "static" and "parent" keywords (#1056)
* extract ObjectReference enum

* re-use ObjectReference

* inline createStaticProtectedPropertyWithDefault() to single symfony rule

* remove unused resolveNativeClassMethodReflection()

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2021-10-25 15:26:52 +02:00
Tomas Votruba
ffa3915630
fix getArgs() missing in phpstan scoped version in rector-src packages (#936) 2021-09-30 13:25:26 +00:00
Abdul Malik Ikhsan
17cfa9f376
Update to nikic/php-parser 4.13.0 (#904)
* Update to nikic/php-parser 4.13.0

* check Arg on PregMatchTypeCorrector

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* check Aeg on NodeTransformer

* check arg on RegexPatternArgumentManipulator

* [ci-review] Rector Rectify

* check Arg on FuncCallManipulator

* check Arg on ClassMethodAssignManipulator

* check Arg on StringifyStrNeedlesRector

* [ci-review] Rector Rectify

* Arg check on CompactFuncCallAnalyzer

* Arg check on CompactFuncCallAnalyzer

* check Arg on CallableInMethodCallToVariableRector

* check Arg on CallableInMethodCallToVariableRector

* Arg check on BeConstructedWithAssignFactory

* Add ArgsAnalyzer to check Arg instance in in Args position

* Arg check on SubstrMatchAndRefactor

* Arg check on NewArgToMethodCallRector

* check Arg on ConsistentImplodeRector

* Arg check on DuringMethodCallFactory

* Arg check on CountOnNullRector

* Arg check on ExportToReflectionFunctionRector

* Arg check on ImplodeAnalyzer

* Arg check on WhileEachToForeachRector

* Arg check on DowngradeIsCountableRector

* Arg check on VariableNaming

* Arg check on ConditionResolver

* Arg check on DirNameFileConstantToDirConstantRector

* Arg check on NewFluentChainMethodCallNodeAnalyzer

* Arg check on MbStrrposEncodingArgumentPositionRector

* Arg check on UnwrapFutureCompatibleIfFunctionExistsRector

* Arg check on JsonArrayFactory

* Arg check on RemoveFuncCallRector

* Arg check on ArrayKeyExistsOnPropertyRector

* Arg check on FunctionExistsFunCallAnalyzer

* Arg check on SetTypeToCastRector

* Arg check on ReplaceEachAssignmentWithKeyCurrentRector

* Arg check on PregMatchTypeCorrector

* Arg check on SwapFuncCallArgumentsRector

* Arg check on FilterVarToAddSlashesRector

* Arg check on ClassOnObjectRector

* Arg check on ClassOnObjectRector

* Arg check on CallerParamMatcher

* Arg check on ArgumentFuncCallToMethodCallRector

* add ArgsAnalyzer::isArgsInstanceInArgsPositions() for multi check directly

* Arg check on ArraySpreadInsteadOfArrayMergeRector

* Arg check on GetDebugTypeRector

* Arg check on GetDebugTypeRector

* Arg check on StringifyDefineRector

* Arg check on DowngradeArrayKeyFirstLastRector

* Arg check on IsArrayAndDualCheckToAble

* Arg check on CreateFunctionToAnonymousFunctionRector

* Arg check on AddArrayDefaultToArrayPropertyRector

* Arg check on IsObjectOnIncompleteClassRector

* Arg check on ForToForeachRector

* Arg check on ClassMethodNodeRemover

* Arg check on CompactConverter

* Arg check on IsAWithStringWithThirdArgumentRector

* Arg check on CallUserFuncArrayToVariadicRector

* Arg check on MysqlPConnectToMysqliConnectRector

* Arg check on MysqlAssignToMysqliRector

* Arg check on InArrayAndArrayKeysToArrayKeyExistsRector

* Arg check on NonVariableToVariableOnFunctionCallRector

* Arg check on VersionCompareFuncCallToConstantRector

* fix test

* Arg check on StrEndsWithRector

* Arg check on TokenManipulator

* Arg check on StrStartsWithFactory

* Arg check on DowngradeIsIterableRector

* Arg check on DowngradeStripTagsCallWithArrayRector

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* Arg check on ChangeDiffForHumansArgsRector

* Arg check on ThrowWithPreviousExceptionRector

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* Arg check on StrposMatchAndRefactor

* Arg check on UseMessageVariableForSprintfInSymfonyStyleRector

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* fix

* Arg check on PhpSpecClassToPHPUnitClassRector

* Arg check on CallTypesResolver

* Arg check on NonVariableToVariableOnFunctionCallRector

* Arg check on DispatchStringToObjectRector

* Arg check on GetClassToInstanceOfRector

* Arg check on StrncmpMatchAndRefactor

* Arg check on StrncmpMatchAndRefactor

* Arg check on ArraySpreadInsteadOfArrayMergeRector

* Arg check on ArrayKeysAndInArrayToArrayKeyExistsRector

* Arg check on DowngradeSessionStartArrayOptionsRector

* Arg check on CountArrayToEmptyArrayComparisonRector

* Arg check on DowngradeClosureFromCallableRector

* Arg check on EregToPregMatchRector

* Arg check on GetClassOnNullRector

* Arg check on use RemoveSoleValueSprintfRector

* Arg check on UnSpreadOperatorRector

* Arg check on DowngradeStrContainsRector

* [ci-review] Rector Rectify

* Arg check on ArrayMergeOfNonArraysToSimpleArrayRector

* Arg check on IntvalToTypeCastRector

* Arg check on RemoveUnusedVariableAssignRector

* Arg check on ConsistentPregDelimiterRector

* Arg check on CountManipulator

* Arg check on DowngradeDefineArrayConstantRector

* Arg check on RemoveReferenceFromCallRector

* Arg check on SimplifyInArrayValuesRector

* Arg check on SingleInArrayToCompareRector

* Arg check on SimplifyIfIssetToNullCoalescingRector

* Arg check on StrlenZeroToIdenticalEmptyStringRector

* [ci-review] Rector Rectify

* Add ComplexType check

* Arg check on UnwrapSprintfOneArgumentRector

* Arg check on CurrentAndParentClassMethodComparator

* Arg check on CompactToVariablesRector

* [ci-review] Rector Rectify

* ComplexType check

* Arg check on MockVariableCollector

* re-generate preload.php

* [ci-review] Rector Rectify

* fix phpstan ignore error

* Arg check on FormerNullableArgumentToScalarTypedRector

* ComplexType check on MakeTypedPropertyNullableIfCheckedRector

* Arg check on ArgumentRemoverRector

* using getArgs() on PhpSpecPromisesToPHPUnitAssertRector

* using getArgs() on args using in method call args

* Arg check on PhpSpecMocksToPHPUnitMocksRector

* Arg check on SetCookieRector

* Arg check on StringsAssertNakedRector

* Arg check on PregReplaceEModifierRector

* using getArgs() on multiple count() usage

* using getArgs() on args using in method call args

* using getArgs() on args using in method call args

* using getArgs() on args using in method call args

* Arg check on MysqlFuncCallToMysqliRector

* using getArgs() on args using in method call args

* using getArgs() on args using in method call args

* Arg check on DowngradeCovariantReturnTypeRector

* Arg check on SetCookieOptionsArrayToArgumentsRector

* using getArgs() on too complex check

* Arg check on DowngradeNegativeStringOffsetToStrlenRector

* ensure preload always used when file exists

* Arg check on SimplifyFuncGetArgsCountRector

* set back reportUnmatchedIgnoredErrors as different between local and github

* Arg check on ArgumentDefaultValueReplacer

* fix test of getArgs() on MysqlQueryMysqlErrorWithLinkRector

* Arg check on SymmetricArrayDestructuringToListRector

* Arg check on UseMessageVariableForSprintfInSymfonyStyleRector

* Arg check on ConsistentPregDelimiterRector

* Arg check on CallUserFuncToMethodCallRector

* Arg check on ArrayKeyExistsTernaryThenValueToCoalescingRector

* Arg check on SimplifyStrposLowerRector

* Arg check on CompactToVariablesRector

* Arg check on CompactToVariablesRector

* Arg check on ChangeArrayPushToArrayAssignRector

* Arg check on ChangeArrayPushToArrayAssignRector

* Arg check on CompactConverter

* final touch: Arg check on CallUserFuncWithArrowFunctionToInlineRector

* fix

Co-authored-by: GitHub Action <action@github.com>
2021-09-27 17:29:16 +02:00
Tomas Votruba
a8a79d0b98
[Arguments] Use native types over weak string to define types (#903)
* [Arguments] Use native types over weak string to define types

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2021-09-19 12:54:47 +02:00
Zing
3ff17513c4
[Arguments] Add the missing default value and type for the added arguments (#837) 2021-09-19 11:02:33 +02:00
Abdul Malik Ikhsan
a81fd4e050
[CodingStyle] Add NewlineAfterStatementRector (#787)
Co-authored-by: GitHub Action <action@github.com>
2021-08-30 10:13:52 +02:00
Tomas Votruba
d8b3be9bfb
[Arguments] Make ArgumentAdderRector notify user only on changed args (#780) 2021-08-27 12:03:17 +00:00
Zing
b4392749f4
Fix some code samples (#535) 2021-07-28 19:46:22 +07:00
Abdul Malik Ikhsan
2fc18bd2c0
[Rectify] Manual twice run rector against rules directory (#448)
* [Rectify] Manual twice run rector against rules directory

* cs fix

* manual rollback comment

* re-run rector and cs fix
2021-07-18 02:00:22 +00:00
Tomas Votruba
294bea2d18
[FileProcessor] Run untill the file is fixed completelly (#432)
* try file doule run

* improve test fixtures by removed old class names

* remove ValueObjectWrapArgRector, not very useful

* [CodeQualityStrict] Remove VarInlineAnnotationToAssertRector, way too strict and unreliable

* [CodeQualityStrict] Remove ParamTypeToAssertTypeRector, way too strict and better union types

* improve DowngradeStripTagsCallWithArrayRector on downgrade

* correct NormalizeNamespaceByPSR4ComposerAutoloadRector

* decouple UndefinedVariableResolver

* work in rogres on assign array

* [PHP 7.1] Improve AssignArrayToStringRector to work with assign node directly
2021-07-14 20:51:35 +02:00
Tomas Votruba
48784457eb
Fix doctrine inflector bug downgrade (#388) 2021-07-05 16:58:37 +02:00
Tomas Votruba
904a5a7a1c
Make use of ClassMethodReturnVendorLockResolver (#377)
Co-authored-by: GitHub Action <action@github.com>
2021-07-04 23:04:09 +02:00
Tomas Votruba
dfd048342b
[PHP 8.0] Run union types for filled param type too (#331)
Co-authored-by: GitHub Action <action@github.com>
2021-06-29 16:11:40 +02:00
Tomas Votruba
2a394c750f
Reflection cleanup + inline union types for couple of param docs (#330) 2021-06-29 15:25:57 +02:00
Tomas Votruba
1a3afef04d
PHPStan updated and static fixes (#192) 2021-06-10 10:33:49 +00:00
TomasVotruba
3818dfdbfc unprefix instanceof in PhpFileLoader.php since Symfony 5.3 2021-06-05 20:42:03 +02:00
Tomas Votruba
f7e9986835
[PHP 8.0] Add downgrade for str_starts_with() (#126) 2021-05-30 10:02:38 +00:00
Tomas Votruba
b90952fdeb
Let Rector upgrade itself to PHP 8 🤖😇 (#123) 2021-05-30 00:00:30 +02:00
Tomas Votruba
e539072713
[PHP 8.0] Add DoctrineAnnotationClassToAttributeRector (#78) 2021-05-20 22:52:07 +00:00
Sebastian Schreiber
e961ed1750
[TASK] Add FunctionArgumentDefaultValueReplacerRector (#63) 2021-05-18 01:10:56 +02:00
Tomas Votruba
b3b001a445
[PHP 7.4] Add more typed properties (#23)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-05-12 12:16:44 +02:00
Tomas Votruba
f451b0b8e1
[PHP 8.0] Bump to promoted properties (#4) 2021-05-11 01:33:01 +02:00
TomasVotruba
0800c7cdc3 fix cs 2021-05-06 20:51:25 +02:00
Tomas Votruba
2037d55d6b
[PHP 8.1] Add ReturnNeverTypeRector (#6283) 2021-05-02 10:46:55 +00:00
TomasVotruba
7192eb2a4b fix type 2021-04-23 00:08:34 +02:00
Tomas Votruba
6ced3bd32a
Add upgrade path to Rector 0.10 - upgrade set included (#6061)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-09 01:12:42 +00:00
Zing
ff9173ff35
Stripping quotation marks of argument default value (#5997) 2021-03-26 13:45:54 +07:00
Tomas Votruba
157c39aefc
[DX] move src/tests rules from micro-packages to single PSR-4 structure (#5826) 2021-03-12 23:20:25 +01:00