195 Commits

Author SHA1 Message Date
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
661b2f0a65
[Symplify 9] Follow up + phpstan rules tidying (#4625)
* improve static

* improve phpstan rules

* [PHPStanExtensions] Drop CheckCodeSampleBeforeAfterAlwaysDifferentRule, already part of domain in CodeSample

* cleanup
2020-11-16 23:32:24 +00: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
7203ff0770
[DX] Fixes #4588 Enable PreferThisOrSelfMethodCallRector in rector-ci.php (#4597)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-13 12:15:33 +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
91a354c080
[NetteCodeQuality] Fix ChangeFormArrayAccessToAnnotatedControlVariableRector for in-closure (#4506)
* [NetteCodeQuality] Fix ChangeFormArrayAccessToAnnotatedControlVariableRector for in-closure

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* fix name

* fix unknown mixed type on fluent

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-29 21:25:35 +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
Abdul Malik Ikhsan
9e0b632e4e
[CodeQualityStrict] Add CountArrayToEmptyArrayComparisonRector to CodeQualityStrict (#4496)
Co-authored-by: rector-bot <tomas@getrector.org>
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2020-10-29 09:59:39 +01: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
Tomas Votruba
44b27f779e
[EarlyReturn] Decouple new set (#4490)
* [set] decouple new code-quality-strict

* decopule early-return set [closes #4464]

* [docker] drop prestissimo, as composer v2 does not need it

* [ci] move coding standard to ci_review

* [ci] try to run rector-ci on contributors
2020-10-27 13:47:37 +00:00
Abdul Malik Ikhsan
7a1ea1328b
[CodeQuality] Register MoveOutMethodCallInsideIfConditionRector to config code-quality set (#4477)
* [CodeQuality] Register MoveOutMethodCallInsideIfConditionRector to config code-quality set

* rename use string parameter

* phpstan

* fix false positive string param to be var === variable name

* fix false positive

* phpstan

* ensure not same variable

* phpstan

* add ucfirst after var

* add fixture failing test for variable exists to be skipped

* add fixture failing test for variable exists in previuos statement

* phpstan space

* add handling variable exists in previous statement and in ClassMethod/Functions args

* handle exists but inside if

* reduce complexity

* clean up

* clean up

* cs fix

* phpstan

* remove - in variable

* use fallback when first character is numeric

* using regex to check string start alpha for variable

* cs fix

* use ClassConstFetch name to set variable name

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* clean up

* fix

* [ci-review] Rector Rectify

* Update rules/code-quality/src/Rector/If_/MoveOutMethodCallInsideIfConditionRector.php

* Update rules/code-quality/src/Rector/If_/MoveOutMethodCallInsideIfConditionRector.php

Co-authored-by: rector-bot <tomas@getrector.org>
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2020-10-26 14:03:26 +00:00
Tomas Votruba
0f2e6d407e
[DoctrineAnnotaitonGenerated] Update to doctrine/annotations 1.11 + fix static (#4479) 2020-10-25 14:43:05 +01:00
Tomas Votruba
6c51f3fb4f
[Restoration] Add InferParamFromClassMethodReturnRector (#4471)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-21 23:06:24 +02:00
TomasVotruba
009e73886c typo 2020-10-18 11:02:40 +02:00
Tomas Votruba
fd9bd00713
[DoctrineCodeQuality] Fix oveCurrentDateTimeDefaultInEntityToConstructorRector for default value (#4436)
* [DoctrineCodeQuality] Fix oveCurrentDateTimeDefaultInEntityToConstructorRector for default value

* re-use local property method

* improve new_ nesting

* [rector] improve new_ nesting

* static fixes

* bump deps

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-18 08:45:56 +00:00
Tomas Votruba
01514ab9a8
[SimplePhpDocParser] Add README + getParam*() helper methods (#4393) 2020-10-11 16:17:43 +02:00
Igor
35537dba84
[SOLID] Change if && to early return (#4344)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-10 18:27:13 +02:00
Tomas Votruba
7d56318046
[Legacy] From file system Rector to classic Rector (#4373)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-09 10:11:22 +02:00
Tomas Votruba
5597e57e12
[PHP 8.0] Add importing of Route, fix name to Annotation\Route one (#4352) 2020-10-04 14:24:49 +00:00
Abdul Malik Ikhsan
0680e70035
[naming] move UnderscoreToCamelCaseLocalVariableNameRector to Naming Set (#4346) 2020-10-04 12:48:43 +02:00
TomasVotruba
4103cbce07 fix cs 2020-10-02 12:07:55 +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
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
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
Igor
a3c9dabdf6
Fix PHPStan constants issues (#4248) 2020-09-17 21:24:34 +02:00
Igor
f2ecdeb0b1
[Naming] Foreach over "data", renames to "datum" (#4221)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-15 10:23:13 +02: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
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