968 Commits

Author SHA1 Message Date
Tomas Votruba
872f13b27d
rename to value object constants (#4018) 2020-08-24 22:37:12 +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
26e9163a10
[phpstan] add rule to prevent array with string keys (#4012)
* [phpstan] Add ForbiddenArrayWithStringKeysRule

* [compiler] use SmartFileSystem
2020-08-23 13:39:26 +00:00
Tomas Votruba
9a88e032a2
[docs] print object configuration (#4010)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-23 12:39:59 +02: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
38c2c11ded
show configuration (#4007)
* show configuration

* [rector] show configuration

* [cs] show configuration

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-22 20:02:50 +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
TomasVotruba
6f53f55798 fix cs 2020-08-22 19:13:22 +02:00
Tomas Votruba
766853315e
[Naming] Add MakeIsserClassMethodNameStartWithIsRector (#4005) 2020-08-22 19:04:25 +02:00
Tomas Votruba
9164d46a3b
[Naming] Add MakeGetterClassMethodNameStartWithGetRector (#4003)
* [Naming] Add MakeGetterClassMethodNameStartWithGetRector

* [rector] [Naming] Add MakeGetterClassMethodNameStartWithGetRector

* [cs] [Naming] Add MakeGetterClassMethodNameStartWithGetRector

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-22 15:46:09 +00:00
Tomas Votruba
451b638435
Fix lazy command chain removal (#4001) 2020-08-22 15:40:19 +02:00
Tomas Votruba
d75e8011a3
[PHP 7.0] Fix node adding to NonVariableToVariableOnFunctionCallRector (#4000)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-22 15:36:09 +02:00
Marek Šimeček
5a342d9545
lazy command failing test (#3881)
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
Co-authored-by: Marek Šimeček <marek.simecek@footshop.cz>
2020-08-22 15:26:35 +02:00
Dmytro Naumenko
fc6e584721
Failing test: Reset in a condition produces a LogicException (#3997) 2020-08-22 15:20:56 +02: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
Dmytro Naumenko
04597e9685
Failing test: Multiple resets of the same func in a array (#3998) 2020-08-22 13:03:27 +02:00
dobryy
857fd25168
RenameParamToMatchTypeRector doesn't skip variable that is used in callback function use statement (#3970)
* Include use in rename

* [rector] Include use in rename

* [rector] [rector] Include use in rename

* [cs] [rector] Include use in rename

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-21 17:13:56 +00:00
Tomas Votruba
fd69d845e4
Refactor extra file tests wobbly arrays to typed value objects (#3996) 2020-08-21 13:30:28 +02:00
Tomas Votruba
6a442eddd9
merge CorrectDatetimeEntityPropertyDefaultToConstructorRector to MoveCurrentDateTimeDefaultInEntityToConstructorRector (#3978)
* merge CorrectDatetimeEntityPropertyDefaultToConstructorRector to MoveCurrentDateTimeDefaultInEntityToConstructorRector

* [rector] merge CorrectDatetimeEntityPropertyDefaultToConstructorRector to MoveCurrentDateTimeDefaultInEntityToConstructorRector

* add Throw Expr to docs

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-21 09:47:44 +00:00
dobryy
afa7456a05
[DX] Architecture rules respect namespace (#3983) 2020-08-20 13:56:36 +02:00
dobryy
21d0f01383
[DX] TemplateAnnotationToThisRenderRector fixture's namespace issue (#3984) 2020-08-20 13:56:06 +02:00
Tomas Votruba
86a3252d0d
fix class call (#3990)
* fix class call

* [rector] fix class call

* [cs] fix class call

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-19 14:14:08 +00:00
Oliver Nybroe
4090c58ce1
Add failing test case for #3981 (#3986) 2020-08-19 15:45:50 +02: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
dobryy
2e7bdca4e2
[DX] Rename namespaces respect node type (#3973) 2020-08-18 17:57:30 +02: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
Tomas Votruba
664388561d
Recipe array to object (#3966)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-16 00:49:15 +02:00
Mark Sch
2d7469efb8
Add AssertEqualsToSameRector (#3958) 2020-08-15 19:35:07 +02:00
Michał Włodarczyk
e91aed6cdc
Fix sample configuration generation (#3957) 2020-08-15 11:25:01 +02:00
Tomas Votruba
33d992497a
[Doctrine] Add constructor getRepository to service (#3954) 2020-08-13 01:04:23 +02:00
Tomas Votruba
9f9194188f
add new ManagerRegistry namespace (#3952) 2020-08-12 20:05:04 +00:00
Tomas Votruba
74fc11088d
move Polyfill to rules (#3951) 2020-08-12 18:30:42 +00:00
Tomas Votruba
8784a81ff7
[Fluent] Add factory case (#3950) 2020-08-12 20:24:52 +02: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
e4af8cc721
[Order] Order constants by visibility (#3934)
* [Order] Order constants by visibility

* phpstan iterable types fixes

* Fix PHPStan issue (unrelated to PR)

* Doc Update
2020-08-10 21:59:40 +00:00
Tomas Votruba
172653b606
drop EnsureDataProviderInDocBlockRector, job for coding standards (#3938) 2020-08-10 10:40:22 +02:00
dobryy
0f63ef4b1c
[Order] Visibility rules refactoring (#3933)
* [Order] Visibility rules refactoring

* [Order] Import missed FQCN

* phpstan iterable types fixes
2020-08-09 19:21:31 +02:00
dobryy
86e1ab7e0a
fixture for the issue #3931 (#3937) 2020-08-09 00:21:45 +02:00
dobryy
05ece4e8d1
[Order] Order properties by visibility (#3929) 2020-08-08 00:21:17 +02: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