3525 Commits

Author SHA1 Message Date
Tomas Votruba
3d03ec4beb
Removing single-rule elastic package set, merge Decomplex set to CodingStyle, merge FrameworkMigration to NetteToSymfony (#4079)
* drop elasticsearch-dsl50, used for single change, unmaintained

* [CodingStyleAdvanced] Move UseMessageVariableForSprintfInSymfonyStyleRector from single-rule set Decomplex to CodingStyleAdvanced

* merge FrameworkMigration with 1 class to NetteToSymfony

* [Transform] Move ServiceGetterToConstructorInjectionRector to Transform set

* [Transform] Move ReplaceParentCallByPropertyCallRector to Transform package

* [Transform] Move StaticCallToFunctionRector to Transform

* update docs

* [Transform] Move NewToStaticCallRector to Transform
2020-08-30 18:48:37 +00:00
Tomas Votruba
f8b485305f
Add multiple annotation support on class (#4064)
* add test case for #3230

* position

* add support for multi doc annotations

* [rector] add support for multi doc annotations

* [cs] add support for multi doc annotations

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-29 23:12:20 +00:00
Tomas Votruba
4a2ba04b05
report @var changes (#4063) 2020-08-29 20:18:32 +02:00
Tomas Votruba
6b39193992
report doc changes (#4060) 2020-08-29 18:18:24 +02:00
Tomas Votruba
351e59fa3b
Fix array type (#4058)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-29 16:20:27 +02:00
Tomas Votruba
41a9b63c6f
fix ci (#4057) 2020-08-29 11:03:40 +02:00
dobryy
d40309963c
[Type Declaration] Create new unit test for ArrayTypeMapper with fixes (#4054)
* Create new unit test for ArrayTypeMapper with fixes

* Fix typo in method name that breaks all tests

* Remove skip too many fixtures to implement the fix for these fixtures as a next PR.
2020-08-29 10:41:19 +02:00
Tom Pavelec
36b24b2bfc
fix: swapped naming of camel and pascal cases (#4047) 2020-08-28 18:07:15 +02:00
dobryy
f6fba29169
[Type Declaration] The smallest possible fixture fixed ReturnUuid (#4044)
* the smallest possible fixture fixed

* fix default key integer

Co-authored-by: TomasVotruba <tomas.vot@gmail.com>
2020-08-28 07:00:03 +02:00
dobryy
5b4797af85
[Type Declaration] Fix unwrapping of multiple union types (#4043) 2020-08-27 21:05:00 +02:00
Tomas Votruba
650dcc8ef0
beware reference (#4039) 2020-08-27 12:19:22 +02:00
Tomas Votruba
dfe158e2da
[DX] Various value objects added (#4034)
* [DX] Add TypeToStaticCall

* [DX] Add ClassConstantRename

* [DX] Add IssetUnsetToMethodCall

* [DX] Add MethodToYield

* drop unamtained shopware sets

* [DX] Add RenamedAnnotationInType

* [DX] Add MethodCallWrap

* [DX] Add RenamedProperty

* [DX] Add StringToClassConstant

* [DX] Add ArgumentSwap

* simplify rename function rector

* [DX] Add RemovedFunctionArgument

* [DX] Add MethodCallToService

* [DX] Add UnprefixedMethodToGetSet

* [DX] Add PseudoNamespaceToNamespaceRector

* [DX] Add FunctionArgumentSwap

* [DX] Add StaticCallToFunction

* [DX] Add ParentCallToProperty

* [DX] Add ParentDependency

* [DX] Add CallWithParamRename

* [DX] Added MethodCallRenameWithAddedArguments

* [DX] Add PropertyToMethodCall

* [DX] Add PropertyToMethodCall

* [rector] [DX] Add PropertyToMethodCall

* [cs] [DX] Add PropertyToMethodCall

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-26 10:54:53 +00:00
Tomas Votruba
44d3ec8b7a
[DX] Add MethodReturnType value object (#4020)
* re-enable rule

* add MethodReturnType value object

* drop sylius deprecated sets, as not maintained for last 2 years
2020-08-25 18:34:49 +00:00
Tomas Votruba
c1653070f5
[phpstan] Add rule for complex config (#4015)
* [phpstan] Add ForbiddenComplexArrayConfigInSetRule

* add MethodCallRename value object

* [SymfonyPhpConfig] Add array to value object configuration rule

* apply first MethodCallRename value object
2020-08-24 22:26:14 +00:00
Tomas Votruba
de4748f935
README + recipe improvements (#4017)
* rector-recipe and README improvements

* ci: add generate command test
2020-08-24 21:25:26 +00:00
Tomas Votruba
41b679cb2a
[DX] Replacing arrays with objects (#4008)
* [phpstan] Add forbidden array destruct to prevent array mess

* use ArrayCallable value object

* add OpeningAndClosingSpace

* drop ConstructorInjectionToActionInjectionRector, antipattern

* use value objects

* [rector] use value objects

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-23 09:39:09 +00:00
Tomas Votruba
4ef653976f
Fix invalid set reporting (#4006)
* do not use internal rectors

* report invalid set

* remove dashes before number in set name

* [rector] remove dashes before number in set name

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-22 19:27:41 +00:00
Tomas Votruba
786095f328
refactoring of variable name counted (#3999)
* fix variable rename scoping

* [rector] fix variable rename scoping

* [cs] fix variable rename scoping

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-22 13:02:55 +00:00
Tomas Votruba
1f61fe34f0
import repo entity (#3988)
* various fixes

* add import for generic types

* bump to newer phpstan with php-parser 4.9
2020-08-19 13:20:16 +00:00
Tomas Votruba
1b059ee0c3
[DoctrineCodeQuality] Add ChangeBigIntEntityPropertyToIntTypeRector (#3977) 2020-08-17 13:21:59 +02:00
Tomas Votruba
c3eb9f6ada
[DoctrineCodeQuality] Add few entity rules (#3972)
* [DoctrineCodeQuality] Add few entity rules

* [rector] [DoctrineCodeQuality] Add few entity rules

* [cs] [DoctrineCodeQuality] Add few entity rules

* [rector] [cs] [DoctrineCodeQuality] Add few entity rules

* [cs] [cs] [DoctrineCodeQuality] Add few entity rules

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-16 12:39:59 +00:00
dobryy
003afc1435
[Order] Move ClassLike and Class_ rules into correct namespaces (#3969)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-16 13:42:22 +02:00
dobryy
d893ee7209
[Order] Order first level class statements (#3968)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-16 12:08:37 +02:00
TomasVotruba
3d5585aa74 add changeItem() 2020-08-16 01:53:21 +02:00
TomasVotruba
5a35e0a069 add get options to ColumnTagValueNode 2020-08-16 01:43:02 +02:00
TomasVotruba
4562e9b30e fix php snippet detection 2020-08-16 01:35:22 +02:00
TomasVotruba
abbb287d0b update rector recipe 2020-08-16 01:29:16 +02:00
Tomas Votruba
664388561d
Recipe array to object (#3966)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-16 00:49:15 +02:00
Tomas Votruba
6751ff37e8
make sure recipe is loaded (#3964) 2020-08-15 11:39:08 +00:00
Tomas Votruba
a7a72e2fb3
add test case for 3rd party generator + fix it (#3963)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-15 12:39:52 +02:00
Tomas Votruba
9946e88c9a
[RectorGenerator] prevent incorrect package configuration (#3962)
* preven incorrect package configuration

* update create-recipe to rector-recipe, with prefix and better discoverability

* [rector] update create-recipe to rector-recipe, with prefix and better discoverability

* [cs] update create-recipe to rector-recipe, with prefix and better discoverability

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-15 09:14:54 +00:00
TomasVotruba
94064a3dd1 fix template paths for package 2020-08-14 17:44:42 +02:00
Tomas Votruba
33d992497a
[Doctrine] Add constructor getRepository to service (#3954) 2020-08-13 01:04:23 +02:00
Tomas Votruba
74fc11088d
move Polyfill to rules (#3951) 2020-08-12 18:30:42 +00:00
Tomas Votruba
f71b242924
[Defluent] Allow DateTime to be fluent (#3947)
* ignore prefixed conflcits

* note

* skip date-time from defluencing

* drop parameter name guard, not needed anymore

* make use of addNodesAfterNode()
2020-08-12 12:32:45 +00:00
Tomas Votruba
106fb1101a
service entity repository combo (#3945)
* service entity repo combo

* apply cs, add tests, fixes

* update doc parser

* [Generic] Add RemoveAnnotationRector

* add nullsafe nodes to docs

* drop AddEmptyLineBetweenCallsInPhpConfigRector, not that useful

* namespace and phpstan fix

* [ci] merge PHPStan compat to one job, no gain split attention

* [rector] [ci] merge PHPStan compat to one job, no gain split attention

* [cs] [ci] merge PHPStan compat to one job, no gain split attention

Co-authored-by: Marek Šimeček <marek.simecek@footshop.cz>
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-12 09:44:34 +00:00
dobryy
a3be7e03ca
[DX] Rename namespaces of Rector rules to respect node, instead of domain (#3911) 2020-08-12 11:08:59 +02:00
Tomas Votruba
7a603dde2d
[TypeDeclaration] Add nested key support (#3941)
* [TypeDeclaration] Add nested key support

* [rector] [TypeDeclaration] Add nested key support

* [cs] [TypeDeclaration] Add nested key support

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-11 11:58:03 +00:00
Tomas Votruba
1c4b510513
PHPStan: require iterable types (#3936)
* phpstan: require iterable types

* add link on relative path and line

* fix missing class type

* typed array in Rector code + add data provide support resolver

* remove duplicated set

* drop unused yaml ecs config

* add out-of-the-box directory for 3rd party packages

* static fixes

* [rector] static fixes

* [cs] static fixes

* [rector] [cs] static fixes

* generic types

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-11 10:59:04 +00:00
dobryy
29d44284cc
[Order] Order class methods by visibility (#3923)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-07 18:23:40 +02:00
Tomas Votruba
ec28719c6c
make use of NodeConnectingVisitor + improve generate Rector docs (#3925) 2020-08-07 11:30:05 +02:00
Tomas Votruba
734d11f6c9
[SOLID] Skip func calls that change variable in ChangeReadOnlyVariableWithDefaultValueToConstantRector (#3916) 2020-08-07 00:25:25 +00:00
Zing
c60fad6976
Fix set path was not found (#3918) 2020-08-06 09:11:41 +02:00
dobryy
411d76f9a9
[Order] Make OrderPrivateMethodsByUseRector process file in one run u… (#3889)
* [Order] Make OrderPrivateMethodsByUseRector process file in one run using while loop

* [Order] Enable rule in CI

* [rector] [Order] Enable rule in CI

* [cs] [Order] Enable rule in CI

* [Order] Use constant for number of max attempts and throw exception when exceeded.

* [rector] [Order] Use constant for number of max attempts and throw exception when exceeded.

* [cs] [Order] Use constant for number of max attempts and throw exception when exceeded.

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-05 22:45:36 +02:00
dobryy
7baec08138
Check that Recipe node types are imported (#3904)
* Check that Recipe node types are imported

* [rector] Check that Recipe node types are imported

* [cs] Check that Recipe node types are imported

* Update packages/rector-generator/src/ValueObject/Configuration.php

Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>

* Use `is_a` instead of `class_exists` in order to also check whether node type implements \PhpParser\Node interface

Co-authored-by: rector-bot <tomas@getrector.org>
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2020-08-04 22:34:24 +00:00
Tomas Votruba
fa9f618866
skip configure unless in tests (#3907) 2020-08-04 19:12:46 +00:00
Tomas Votruba
7212366606
[Naming] Decouple RenameParamToMatchTypeRector (#3906)
* [Naming] Decouple RenameParamToMatchTypeRector

* remove overrlaping useless test fixtures

* [rector] remove overrlaping useless test fixtures

* [cs] remove overrlaping useless test fixtures

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-04 18:30:31 +00:00
Tomas Votruba
09f67341ee
Add set-path constant support (#3886) 2020-08-03 21:14:41 +02:00
Tomas Votruba
b61d22d56e
[Naming] Allow uuid to have name id (#3883)
* [Naming] Allow uuid to have name id

* add REPOSITORY_AS_SERVICE set

* [rector] add REPOSITORY_AS_SERVICE set

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-03 17:52:40 +00:00
Tomas Votruba
e7429d96a4
make use of constant (#3875) 2020-08-02 13:17:33 +00:00