175 Commits

Author SHA1 Message Date
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
kodiakhq[bot]
82d3304f47
Merge pull request #3569 from rectorphp/php80-switch-to-match
[PHP 8.0] Add ChangeSwitchToMatchRector
2020-07-30 16:42:20 +00:00
TomasVotruba
dc14ddd0b9 [PHP 8.0] Add ChangeSwitchToMatchRector 2020-07-30 18:19:53 +02:00
TomasVotruba
ce480d3983 remove SplitLine value object 2020-07-30 16:40:34 +02:00
TomasVotruba
2ad011673f [PHP 7.0] Fix variable name on static call 2020-07-30 15:53:21 +02:00
TomasVotruba
2741893bbf [RectorGenerator] Refactoring to testable code 2020-07-29 20:50:31 +02:00
TomasVotruba
1a82613c3f rename ValidateFixtureCommand to more explicit ValidateFixtureContent 2020-07-27 10:51:10 +02:00
TomasVotruba
99db894192 restore types 2020-07-27 10:44:51 +02:00
dobryy
f37cd4cac3 [Order] Apply rule 2020-07-26 15:11:41 +02:00
TomasVotruba
8be555843b drop ValidateServicesInSetsCommand, now handled in PHP analysis 2020-07-26 11:47:38 +02:00
TomasVotruba
0188d802d2 use SmartFileSystem over Nette FileSystem 2020-07-24 14:39:10 +02:00
TomasVotruba
3a9375007e decouple Set package 2020-07-21 01:39:24 +02:00
TomasVotruba
2f927842a7 move sets to single /set directory 2020-07-21 00:46:53 +02:00
TomasVotruba
ee9d0439cf make use of Set constants 2020-07-20 01:06:56 +02:00
TomasVotruba
aeb7937972 add set constants + command to generate them 2020-07-20 01:00:49 +02:00
TomasVotruba
6a4792abf4 apply new naming rule 2020-07-19 23:36:10 +02:00
TomasVotruba
9c7cbc65ad [rector] apply on the rest 2020-07-19 21:05:14 +02:00
TomasVotruba
0d3306250f [utils] switch YAML to PHP 2020-07-18 19:56:27 +02:00
TomasVotruba
9a5a8fe081 [Utils] Add RequireStringArgumentInMethodCallRule 2020-07-13 14:53:00 +02:00
rector-bot
642d42326f fixup! remove func call from methods calls 2020-07-06 00:04:12 +00:00
TomasVotruba
3c3c3a9530 remove func call from methods calls 2020-07-06 01:59:41 +02:00
TomasVotruba
dfd4458254 add StrictMixedTypeMapper 2020-07-05 23:37:07 +02:00
TomasVotruba
c16481e2f5 [CI] simlify jobs to matrix 2020-07-05 23:37:07 +02:00
TomasVotruba
78a97fb8bf typos, skip empty class 2020-07-01 22:28:58 +02:00
TomasVotruba
547e15099d use explicit xBuilder classes to prevent typos and PHPStan and PHPStorm confussion 2020-06-30 01:34:19 +02:00