3296 Commits

Author SHA1 Message Date
Tomas Votruba
87494ce3a6
Print only changed docblocks 🎉🎉🎉 (#5251) 2021-01-20 16:17:59 +00:00
Tomas Votruba
85e7f7fa2c
Make remove parent/name only on component, skip form (#5266) 2021-01-20 15:57:49 +00:00
Jan Lohage
8d6f8369f1
NodeFactory: Allow passing a Cast node to createArrayItems (#5263)
Allow passing a Cast node to createArrayItems
2021-01-20 15:12:00 +01:00
Abdul Malik Ikhsan
c2c5228199
[TypeDeclaration] Improve FlipTypeControlToUseExclusiveTypeRector : add Nullable support for Assign expr (#5254)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-20 11:41:35 +00:00
Tomas Votruba
34168ff9d8
various cherry picks (#5248) 2021-01-19 23:29:52 +00:00
Tomas Votruba
05356b393a
Getting rid of attribute (#5246)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-19 22:32:28 +01:00
Tomas Votruba
81eeb2771b
Various cherry-pick (#5243)
* [Transform] Add VariableMethodCallToServiceCallRector

* use direct phpdocinfo

* cleanup

* narrow DoctrinePropertyAnalyzer

* misc
2021-01-19 20:39:57 +00:00
Tomas Votruba
4b7f6f4a72
use PhpDocTagRemoer as a service (#5242)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-19 19:45:30 +00:00
Tomas Votruba
66d0b61a9d
[Comments] Decouple new package (#5239)
* [Comments] Decopule new package

* fix RemoveNonExistingVarAnnotationRector

* decopule PropertyFetchFinder

* misc

* fix fixed printer

* fix import

* remove dead code

* fix comparing nodes with tokens instead of identical compare

* remove complexity

* decouple IndentCharacterDetector

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-19 19:11:10 +00:00
Tomas Votruba
133322cc65
cherry pick (#5238)
* misc

* decopule DocBlockManipulator misc

* make use static instnaceof

* add markAsChanged() to PhpDocInfo

* decopule DocBlockTagReplacer

* change static annotation naming to service

* misc
2021-01-19 15:03:26 +00:00
Abdul Malik Ikhsan
6b196a96ea
[TypeDeclaration] Register FlipTypeControlToUseExclusiveTypeRector to type-declaration set (#5223)
Co-authored-by: rector-bot <tomas@getrector.org>
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2021-01-19 12:24:48 +01:00
Tomas Votruba
bbe758ab60
phpdoc info refactor part 4 (#5231)
* remove useless docblocks

* misc

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-19 01:15:32 +00:00
Tomas Votruba
ad9448018c
[PhpDocInfo Decouple] Use php doc info from factories, not from attribute (#5229)
* use single method to create docs

* use phpDocInfoFactory instead of getAttribte php doc info in Rectors

* move callig to phpDocInfoFactory

* misc
2021-01-18 21:45:13 +00:00
Tomas Votruba
b9bc05aa44
[PhpDocInfo Decopule] Refactor PhpDocTypeChanger outside the value object (#5226)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-18 20:06:02 +00:00
Tomas Votruba
a7550337f0
Add promoted property in PHP 8.0, when adding a ctor dependency (#5222)
* add PHP 8.0 test

* Add promoted property adding in constructor injection on PHP 8

* update tests to use propert promotion

* fix promoted property adding

* decopule Doctrine registry to manager

* shorter naming

* fix parent ctor completion

* nette promotion fixes

* fixes

* fix property inject

* misc

* misc
2021-01-18 13:09:48 +00:00
Tomas Votruba
cfbe014d67
[PHP 7.3] Fix stirng retype on intersections (#5216)
* [PHP 7.3] Fix stirng retype on intersections

* remove unneeded command layer for showing not enough args

* make sure there is application

* misc
2021-01-17 23:39:13 +00:00
Tomas Votruba
024a97d019
[RemovingStatic] Decouple static (#5207)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-16 22:45:18 +01:00
Tomas Votruba
c0105bde25
Change maximal Rector complexity to 35 to avoid hard coupling to Rector classes (#5206)
* complexity

* decopule GetSubscriberEventsClassMethodFactory and ListenerServiceDefinitionProvider

* decopule UnusedParameterResolver, AssertMethodCallFactory, PropertyFetchWithVariableReplacer

* decopule ParamAndArgFromArrayResolver

* decopule JsonArrayFactory and JsonEncodeStaticCallFactory

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-16 19:11:11 +00:00
Tomas Votruba
04db98620a
Refactor composer modifier to ComposerRector (#5198) 2021-01-16 13:23:37 +01:00
Abdul Malik Ikhsan
4b887f863f
[DeadCode] Register RemoveDeadConditionAboveReturnRector to dead-code config set (#5197)
* [DeadCode] Register RemoveDeadConditionAboveReturnRector to dead-code config set

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-16 11:58:24 +01:00
Abdul Malik Ikhsan
cf142b3f06
[Exclusion] Move SomeRector class to under Tests (#5202) 2021-01-16 11:53:54 +01:00
Tomas Votruba
56409c5a3a
[phpstan] Remove unreported errors and duplicated methods (#5193)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-15 21:27:36 +01:00
Tomas Votruba
7f3cfd93e8
[Privatization] Fix another get class (#5190) 2021-01-15 00:26:37 +00:00
Tomas Votruba
58d97b9853
[Naming] Fix Param type Promoted Rename (#5188)
* [Naming] Make RenameParamToMatchTypeRector skip promoted property

* [Naming] Add property rename to RenamePropertyToMatchTypeRector

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-14 22:44:07 +00:00
Michal Lulco
4bd4a4657b
Full upgrade of codebase including changes in composer.json (#5074)
* Composer changer

* Implemented ChangePackage, ChangePackageVersion and RemovePackage with tests

* Refactored composer processor

* Refaktoring

* Added missing tests

* Added void return type to test

* Changed namespaces and fixed CI tests

* Apply rector rules

* Moved new line to processor from modifier

* Use array copies in tests

* Added descriptions to all construct parameters and inheritDoc to modify methods

* Rewritten ComposerModifierTest to use AbstractKernelTestCase and ComposerModifier as service

* Split MovePackage to 2 classes

* Sort packages if it is set in config

* Rectified

* Rename class ChangePackage to ReplacePackage

* Split class AddPackage to AddPackageToRequire and AddPackageToRequireDev

* Added Version checker and moved modifier classes to separated folder

* Changed array to ComposerJson in modify methods

* Rectifying

* Removed unnecessary docs

* Temporary added fork of composer-json-manipulator

* Removed unused code and replaced InvalidArgumentException to assert
2021-01-12 22:50:42 +01:00
TomasVotruba
e71a107b1b [SymfonyCodeQuality] Create value object in one step 2021-01-12 01:04:45 +01:00
Tomas Votruba
6c11a254aa
[SymfonyCodeQuality] Add ExtractAttributeRouteNameConstantsRector (#5140)
* [SymfonyCodeQuality] Add ExtractAttributeRouteNameConstantsRector

* optimizations
2021-01-11 20:12:10 +00:00
TomasVotruba
d59aa8dfd6 use array arguments on privates caller 2021-01-09 15:51:10 +01:00
Tomas Votruba
4756535d2b
[CodingStyle] Improve unspread array (#5120)
* decouple VendorFileDetector

* decouple SpreadVariablesCollector

* [CodingStyle] Improve UnSpreadOperatorRector to join argument to array
2021-01-09 14:08:02 +00:00
Tomas Votruba
2cf2ee3f41
fix exclusion annotation for non-class rector descripton + simplify (#5117)
* fix exclusion annotation for non-class rector descripton + simplify

* add HasOffsetTypemapper

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-09 00:20:28 +00:00
Tomas Votruba
bc0113dbd7
use templates (#5116) 2021-01-08 23:30:33 +01:00
Tomas Votruba
d478992160
Fix deprecated ref() to service() function, skip empty file (#5112)
* composer: bump to symfony/dependency-injection 5.1, required as minimum by other deps anyway

* use service() over deprecated ref()

* skip empty files

* skip just created props
2021-01-08 14:04:35 +00:00
Abdul Malik Ikhsan
2e5ca7cc34
[ValueObject] Add PHP_80 constant to PhpVersion class (#5109) 2021-01-08 11:17:51 +01:00
Abdul Malik Ikhsan
fe639838d5
[BetterStandardPrinter] Improve duplicate comment handling when duplicated in multi parts (#5107)
* [BetterStandardPrinter] Improve duplicate comment handling when duplicated in multi parts

* clean up

* different comment name fixture

* fix
2021-01-07 20:05:19 +01:00
Abdul Malik Ikhsan
3a2d32c7fa
[BetterStandardPrinter] Failing fixture to not duplicate comment (#5106)
* [BetterStandardPrinter] Failing fixture to not duplicate comment

* Closes #4191

* phpstan
2021-01-07 19:33:27 +01:00
Tomas Votruba
630c3d324e
[PhpVersionResolver] Add project composer.json as source + decouple to composer json fatcory (#5031)
* [PhpVersionResolver] Add project composer.json as source + decouple to composer json fatcory

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-29 00:32:48 +00:00
Tomas Votruba
c7140076ec
use clone const (#5029) 2020-12-28 23:38:05 +00:00
Krystian Marcisz
94a4bb7777
[DX] Add Interactive Mode to Generate command (#4931)
* Add Interactive Mode to Generate command

* CS Fixer

* Unify names

* Unify names

* Fixes

* Fixes

* Fixes

* Check generated tests against the "special hack for PHPUnit"

* Re-use the same input/output in the Generate Command

* Add test for Interactive Mode of Generate Command

* Rename test file

* Use ::class instead of string

* Create Finder instance where it's used

* Create RectorRecipeInteractiveProvider service

* Create RectorRecipeInteractiveProvider service

* Bring back SymfonyStyle as DI service
2020-12-28 18:00:51 +01:00
Tomas Votruba
a7544e85e1
Cleanup exclusion manager test (#5012)
* merge CODING_STYLE_ADVANCED to CODE_QUALITY_STIRCT

* rename split ExclusionManager test to single one
2020-12-27 23:24:28 +00:00
Abdul Malik Ikhsan
d8e13e9144
[AbstractRector] Add rollbackComments (#5005) 2020-12-27 10:54:05 +01:00
Tomas Votruba
ed475a2e3c
[static] no nullable node (#4995)
* move phpstan.neon cusotm rules to rector-rules.neon, to cleanup main config

* enable forbidden rule on nullable nodes

* bump to Symplify 9.0.17

* make name non-nullable

* skip non-nullable

* skip null dim
2020-12-25 20:50:50 +00:00
Tomas Votruba
a4f8a23ecf
[CodeQuality] Move MoveVariableDeclarationNearReferenceRector (#4992) 2020-12-25 17:48:15 +01:00
Tomas Votruba
cffd7ea0ac
[CodingStyle] Move PHPStormVarAnnotationRector (#4985)
* [CodingStyle] Move PHPStormVarAnnotationRector

* [ci-review] Rector Rectify

* [DeadDocBlock] Move RemoveNonExistingVarAnnotationRector here (#4984)

* [DeadDocBlock] Move RemoveNonExistingVarAnnotationRector here

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>

* [ci-review] Rector Rectify

* cleanup docs

* static fixes

* [ci-review] Rector Rectify

* remove duplicated

* multi use case

* misc

* [ci-review] Rector Rectify

* fixes

* remove order set, slow

* move UseMessageVariableForSprintfInSymfonyStyleRector from solid set to coding-style

* make unique-named variables to prevent accidental override and improve readability

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-25 13:20:13 +00:00
Abdul Malik Ikhsan
ec5daad132
[Util] Add StaticInstanceOf (#4979)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-25 12:53:26 +01:00
Tomas Votruba
d465ec83e2
[DeadCode] Move RecastingRemovalRector from PHPStan set (#4983)
* [DeadCode] Move RecastingRemovalRector from PHPStan set

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-25 00:22:45 +00:00
TomasVotruba
0326aec71c renames on regex 2020-12-25 00:28:36 +01:00
TomasVotruba
d337b5753f cleanup 2020-12-25 00:18:02 +01:00
Tomas Votruba
5a47e36b72
Add Visibility consts (#4981) 2020-12-24 23:01:30 +01:00
Tomas Votruba
d03fb14c3f
fix parent visilibty (#4980) 2020-12-24 21:58:07 +01:00
Tomas Votruba
319d6bfca1
add phpstan-for-rector config path, consolidate return type extensions - re-use from Symplify (#4973)
* add phpstan-for-rector config path, to separate phpstan and extensions that help Rector with precise types

* move type value object to value object

* moving

* remove KernelGetContainerAfterBootReturnTypeExtension, use one from symplify

* remove ContainerGetDynamicMethodReturnTypeExtension to ContainerGetReturnTypeExtension

* remove nette extension

* add nette-extension

* removed delegated rule

* delegate implmenets + code sample PHPStan rule to symplify
2020-12-24 16:31:24 +00:00