96 Commits

Author SHA1 Message Date
Tomas Votruba
09f17a7b64
[Downgrade] [PHP 8.0] Add DowngradePropertyPromotionToConstructorPropertyAssignRector (#4762)
* [Downgrade] [PHP 8.0] Add DowngradePropertyPromotionToConstructorPropertyAssignRector

* fix parent

* various fixes for PHP 8.0 tests

* [ci-review] Rector Rectify

* Update rules/downgrade-php80/tests/Rector/Class_/DowngradePropertyPromotionToConstructorPropertyAssignRector/DowngradePropertyPromotionToConstructorPropertyAssignRectorTest.php

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-03 13:27:24 +00:00
Tomas Votruba
080e5cbe00
use symplify/skipper (#4689) 2020-11-26 23:09:21 +01:00
Abdul Malik Ikhsan
a38debb672
[DX] Fixes #4205 Change phpversion from string to php constant int type (#4679)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-24 16:32:49 +01:00
Tomas Votruba
131357aac6
[CodingStyle] Fix lowercase misses in importing, decouple ImportSkipper to collector with ClassNameImportSkipVoters (#4665)
* add import doc block test

* [CodingStyle] Decouple ImportSkipper to ClassNameImportSkipVoters

* drop same short namespace check, not used anywhere
2020-11-20 13:37:53 +00:00
Tomas Votruba
26b71cce1d
[Laravel] Improve static to DI set (#4662) 2020-11-20 01:26:04 +01:00
Tomas Votruba
014985e943
[CodingStyle] Add static support to PreferThisOrSelfMethodCallRector (#4660)
* [CodingStyle] Add static support to PreferThisOrSelfMethodCallRector

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-19 12:37:50 +00:00
Abdul Malik Ikhsan
2d9841594f
[CodingStyle] Skip RemoveDoubleUnderscoreInMethodNameRector on first numeric on new name (#4645) 2020-11-18 17:09:42 +01:00
Abdul Malik Ikhsan
1b354f3e59
[CodingStyle] Improve RemoveParamReturnDocblockRector: handle namespaced @param & @return (#4642)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-18 11:02:10 +01:00
Abdul Malik Ikhsan
d788fd051a
[CodingStyle] Skip RemoveDoubleUnderscoreInMethodNameRector when method name only __ (#4640) 2020-11-18 10:57:50 +01:00
Tomas Votruba
a7705ed0a5
[Symplify 9] First update + switch to RuleDocGenerator (#4616)
* [composer] bump to Symplify 9

* [Symplify 9] Update phpstan rules

* bump to Symplify 9 BETA2

* update AbstractKernel from Tests to Testing namespace

* decoupling removing node trait

* remove fluent calls

* removing variadic

* [CodingStyle] Improve AnnotateThrowablesRector

* bump deps

* Make use of RuleDocGenerator

* first short

* [DocumentationGenerator] Drop deprecated package, RuleSetGenerator now handles it

* import namespace

* update docs
2020-11-16 17:50:38 +00:00
Abdul Malik Ikhsan
2562a2dcee
[CodingStyle] Fixes #4453 Add RemoveParamReturnDocblockRector (#4600)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-13 14:58:17 +01:00
Abdul Malik Ikhsan
3d2c7c30bd
[CodingStyle] Failing test case for cannot change this to self (#4590)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-12 21:50:36 +01: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
a1e50263d2
[cs] improve configured rules types (#4491)
* [cs] improve configured rules types

* [ci] update env variable
2020-10-27 14:00:39 +00:00
Abdul Malik Ikhsan
0680e70035
[naming] move UnderscoreToCamelCaseLocalVariableNameRector to Naming Set (#4346) 2020-10-04 12:48:43 +02: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
Igor
6350692b98
[Naming] Move UnderscoreToCamelCaseVariableNameRector to Naming set (#4312) 2020-09-28 22:35:45 +02:00
Igor
ccb086aab7
[Naming] Make UnderscoreToCamelCasePropertyNameRector work with PropertyRenamer (#4283)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-28 20:29:37 +02:00
Abdul Malik Ikhsan
72b3a3f738
[coding-style] make UnderscoreToCamelCaseVariableNameRector update @param docblock as well (#4305) 2020-09-28 14:25:58 +02:00
Abdul Malik Ikhsan
b49333d628
Fixes #4290 wrong skip assignment not from parameter in UnderscoreToCamelCaseLocalVariableNameRector (#4293)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-25 09:23:30 +02:00
Abdul Malik Ikhsan
26fe7c547c
Add UnderscoreToCamelCaseLocalVariableNameRector to only change local variable name (#4284)
* Add UnderscoreToCamelCaseLocalVariableNameRector to only change local variable name

* revert rector_rules_overview.md

* add param_assign_return fixture

* try check instanceof Return_

* try check instanceof Return_

* implemented handling asssignment with return
2020-09-24 17:45:19 +02:00
Tomas Votruba
d9dd72cd6c
[DOC] Add more spaces between node code samples (#4271) 2020-09-22 15:46:02 +02:00
Abdul Malik Ikhsan
8759d0ee78
[CodingStyle] Bug fix: ReservedKeywordAnalyzer should add _SESSION to NATIVE_VARIABLE_NAMES (#4265)
* Bug fix: ReservedKeywordAnalyzer should add _SESSION to NATIVE_VARIABLE_NAMES

* cs fix
2020-09-21 20:58:55 +00: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
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
geryguilbon
a57d5b8882
Improved rule FollowRequireByDirRector (#4133) 2020-09-06 20:35:24 +02:00
Tomas Votruba
740ccda385
[CodingStyle] Drop SimplifyBoolIdenticalTrueRector, does not bring expected value (#4113) 2020-09-02 20:12:58 +00:00
Abdul Malik Ikhsan
108c6fd52f
Typo fix: NESTED_STIRNGS to NESTED_STRINGS (#4101)
Signed-off-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
2020-09-02 11:56:12 +02:00
Tomas Votruba
83e2db04d8
[CodingStyle] Skip annotation var on already set mixed[] array (#4100)
* [CodingStyle] Skip big constants for var

* skip mixed[] var constant, on purpose

* [rector] skip mixed[] var constant, on purpose

Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-01 20:04:49 +00: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
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
2a6df65a5b
Fix static class call (#4068)
* [CodingStyle] Add static call case to alias removal

* handle static call class alias remove

* [rector] handle static call class alias remove

* [cs] handle static call class alias remove

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-30 12:58:34 +00:00
Tomas Votruba
351e59fa3b
Fix array type (#4058)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-29 16:20:27 +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
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
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
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
Tomas Votruba
42caae413d
drop SimpleArrayCallableToStringRector, as it makes code magical and harder to proces (#3920) 2020-08-06 09:48:34 +00:00
Tomas Votruba
76b4ab7586
[Defluent] New set + various improvements (#3853)
* remove dead-else branch

* add defluent set

* fix type to match

* use constants over strings

* fixup! use constants over strings

* Add fluent as arg support to DefluentMethodCallRector

Co-authored-by: rector-bot <tomas@getrector.org>
2020-07-31 23:08:16 +00:00
TomasVotruba
fe72e003ed use constants in configs 2020-07-30 13:53:53 +02:00
TomasVotruba
c50aedca5c [Nette] add support for getComponent() resolution in form array access 2020-07-25 18:24:40 +02:00
Tomas Votruba
40b734d4ff
Merge pull request #3749 from u01jmg3/pdo-exception
Support exception names that begin with an abbreviation
2020-07-22 00:24:53 +02:00
Jonathan Goode
ac24d76033 Support exception names that begin with an abbreviation 2020-07-21 21:27:18 +01:00
Jonathan Goode
d0b791d823 Create WrapEncapsedVariableInCurlyBracesRector 2020-07-21 19:06:38 +01:00
Jonathan Goode
7da3310cf6 Move existing Rector from the coding-style set to the php70 set 2020-07-21 10:23:25 +01:00
Jonathan Goode
287af13177 Create WrapVariableVariableNameInCurlyBracesRector 2020-07-20 18:23:19 +01:00