199 Commits

Author SHA1 Message Date
Tomas Votruba
5147844615
change RenameSpecFileToTestFileRector filesystem to normal one (#4525) 2020-10-31 16:20:30 +00:00
Tomas Votruba
0513315056
Change file system approach of MultipleClassFileToPsr4ClassesRector to file without namespace node (#4522)
* Change file system approach of MultipleClassFileToPsr4ClassesRector to file without namespace node

* update DecoupleClassMethodToOwnClassRector

* [ci] add rebase jobp

* disable fail fast for unit tests

* misc
2020-10-31 12:59:40 +00:00
Tomas Votruba
34b4d10ea2
[docs] more node cleanup (#4519)
* [TypeDeclaration] Add better return type coverage

* drop less common node snippets
2020-10-30 21:58:39 +00:00
Tomas Votruba
489efd1adf
[docs] add command for used node stats + simplify node docs, so it uses most needed examples over are nodes (e.g. /=) (#4518) 2020-10-30 22:13:56 +01:00
Tomas Votruba
2c120e283e
Inform about useless second part in tests fixture, after -----, if it is identical (#4514)
* embed skip fixture of same before/after

* [Testing] Add exception on identical second half of the fixture, that should not change

* [ci] use composer 2 for code_analysis

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-30 13:56:55 +00:00
Abdul Malik Ikhsan
449801e1f3
Add regex uri to regex constant (#4504)
Co-authored-by: Jan Lohage <j2L4e@users.noreply.github.com>
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-29 19:04:33 +01:00
Tomas Votruba
e845d7cea8
[DoctrineCodeQuality] Add ImproveDoctrineCollectionDocTypeInEntityRector (#4442)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-18 18:29:35 +02:00
Abdul Malik Ikhsan
63615f4197
[PHPStan] Fixes #4433 Add CheckCodeSampleBeforeAfterAlwaysDifferentRule (#4439) 2020-10-18 14:14:55 +02:00
Tomas Votruba
8af70b5ac0
[Defluent] Refactoring to multiple rules (#4400)
* [Defluent] Refactoring to multiple rules

* [Defluent] Decouple defluent-only set, it deserved to have own domain

* cleanup

* [rector] cleanup

* [cs] cleanup

* fixup! cleanup

* static fixes

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-14 04:24:29 +00:00
Tomas Votruba
cb991af9c6
hotfix mysql connection resolving (#4399) 2020-10-12 21:06:24 +02:00
Tomas Votruba
01514ab9a8
[SimplePhpDocParser] Add README + getParam*() helper methods (#4393) 2020-10-11 16:17:43 +02:00
TomasVotruba
40db4ee347 static fixes 2020-10-11 00:55:28 +02:00
Tomas Votruba
a8f55f339f
[DX] Update dump nodes to not-use symfony style (#4356)
* [DX] Update dump nodes to not-use symfony style

* [rector] [DX] Update dump nodes to not-use symfony style

* [cs] [DX] Update dump nodes to not-use symfony style

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-05 09:29:07 +00:00
Tomas Votruba
8ae3868a57
[Restoration] Add RestoreFullyQualifiedNameRector (#4336)
* [Restoration] Add RestoreFullyQualifiedNameRector

* update docs

* use service aware test case for PHPStan rules

* improve FullyQualifiedNameMatcher

* cs fixes

* add return doc resolution

* composer: bump to symfony 4.4/5.1
2020-10-01 19:45:29 +00:00
Abdul Malik Ikhsan
ae816c2c3d
Fixes #4337 : Make Option::SKIP works again with ParameterProvider (#4339) 2020-10-01 18:55:10 +02:00
Tomas Votruba
7aad4bbf2f
[PHPStan] Enable regex constant rule (#4279) 2020-09-23 11:16:40 +02:00
Tomas Votruba
d9dd72cd6c
[DOC] Add more spaces between node code samples (#4271) 2020-09-22 15:46:02 +02:00
Tomas Votruba
a73fc88add
[Docs] update docs with node examples (#4269) 2020-09-22 11:27:44 +02:00
Marek Šimeček
cace25434f
[Docs] Update node docs with examples how to create them - part 2 (#4261)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-21 22:45:35 +02:00
Tomas Votruba
52ccfc0527
[DX] move Nette FileSytem to SmartFileSystem DI (#4262)
* move Nette FileSytem to SmartFileSystem DI

* move Symfony FileSytem to SmartFileSystem

* [ci] run rector diretly, without composer wrap
2020-09-19 09:27:29 +00:00
Marek Šimeček
e0cb8c228b
node docs (#4259) 2020-09-18 16:06:24 +02:00
Tomas Votruba
3c67d23c0e
[Docs] Fixup (#4257)
* fix cs

* misc

* [rector] misc

Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-18 10:28:44 +00:00
Tomas Votruba
2243583537
[Docs] update docs and type check (#4241) 2020-09-18 11:50:55 +02:00
Igor
a3c9dabdf6
Fix PHPStan constants issues (#4248) 2020-09-17 21:24:34 +02:00
dobryy
4e04d96b9c
[DX] PHPStan rule to check getNodeTypes() return classes of PhpParser\Node (#4210)
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2020-09-12 23:14:31 +00:00
dobryy
4fee8c6773
[DX] PHPStan rule to check, that value objects do not have value object suffix (#4206)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-13 01:08:21 +02:00
dobryy
28a55c973e
[DX] Add Rule that checks that Rule + value object have same starts (#4202)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-12 23:19:08 +02:00
dobryy
a6444fb801
[DX] Configurable rule must have configure code sample, and vice versa (#4174)
* [DX] Configurable rule must have configure code sample, and vice versa

* Add ConfiguredCodeSample

* heredocs

* code sample

* fix class

* drop AbstractConfigurableMatchTypeRector

Co-authored-by: TomasVotruba <tomas.vot@gmail.com>
2020-09-11 11:21:48 +02:00
dobryy
f69ea0e023
[Naming] Rename foreach value variable to match method return type (#4130)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-09 10:52:43 +02:00
dobryy
4ca8148453
[DX] Add rule to check "Tests" in namespace for *Test.php files (#4114) 2020-09-03 10:56:19 +02:00
Tomas Votruba
7ac228c638
[CI] Add type-declaration set (#4089)
* [CI] Add type-declaration set

* [rector] [CI] Add type-declaration set

* [cs] [CI] Add type-declaration set

* skip nullable void

* add anonymous parent/interface support

* refactor MultiExceptionCatchRector to use Catch_ over integers

* type fixes

* fix unoin array type override

* remove unused test cases

* drop overcomplicated InlineValidationRulesToArrayDefinitionRector

* skip assign on var

* [rector] skip assign on var

* [cs] skip assign on var

* [rector] [cs] skip assign on var

* skip assign on var

* fixes

* [rector] fixes

* [cs] fixes

Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-01 17:56:30 +00:00
dobryy
95bbb3063c
[DX] Add rule to check not "Tests" namespace outside "tests" directory (#4091)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-01 11:37:59 +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
650dcc8ef0
beware reference (#4039) 2020-08-27 12:19:22 +02:00
Tomas Votruba
dbda0beee8
[DX] Last value objects (#4035)
* [DX] Add CallToFluent

* [DX] Add ArrayToFluentCall

* [DX] Add FactoryMethod
2020-08-26 14:25:28 +00: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
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
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
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
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
2e7bdca4e2
[DX] Rename namespaces respect node type (#3973) 2020-08-18 17:57:30 +02:00
Tomas Votruba
89537b830f
use symplify rule (#3949) 2020-08-12 13:07:43 +00:00
Tomas Votruba
c25cd2e178
misc (#3946)
* ignore prefixed conflcits

* note
2020-08-12 10:03:15 +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
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
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
Tomas Votruba
3ddf965146
FunctionTo* correction renames, add PHPStan rule to check correct category of rule (#3896)
* rename Function* to Func* rector rule

* [Utils] Add RequireRectorCategoryByGetNodeTypesRule

* [PHPUnit] Rename SpecificMethod to MethodCall category to respect subscriberd nodes

* [rector] [PHPUnit] Rename SpecificMethod to MethodCall category to respect subscriberd nodes

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