596 Commits

Author SHA1 Message Date
Tomas Votruba
5d190a3d55
phpstan cleanup config (#4507) 2020-10-29 21:34:51 +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
35502016a6
Improve MoveOutMethodCallInsideIfConditionRector (#4492)
* skip rename

* add method call and variable name for MoveOutMethodCallInsideIfConditionRector

* decouple MethodCallToVariableNameResolver

* use trick with Scope if variable is already defined

* fixup! use trick with Scope if variable is already defined

* cover case with variable name and method call

* add decopule note future

* [ci-review] Rector Rectify

* [ci] try re-trigger ci-review after push automatically

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-27 15:51:44 +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
80d688413d fix stan 2020-10-26 11:44:06 +01:00
Tomas Votruba
bdf9464d25 skip bugged phpstan file 2020-10-25 14:56:11 +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
Tomas Votruba
75d25a1dcb
[CodeQuality] Decouple complete dynamic properties rector, add skip of Closure::bind() (#4466)
* [ci] temporarily hide split monorepo

* [CodeQuality] Decouple complete dynamic properties rector, add skip of bind()

* [rector] [CodeQuality] Decouple complete dynamic properties rector, add skip of bind()

* [cs] [CodeQuality] Decouple complete dynamic properties rector, add skip of bind()

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-20 20:27:12 +00:00
Tomas Votruba
8bdb879a55
[CodeQuality] Add nested foreach foreach that is required for assign (#4459) 2020-10-20 14:24:32 +00: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
Abdul Malik Ikhsan
67bdc35fe5
[core] Add ClassReflectionToAstResolver service (#4438) 2020-10-18 10:31:37 +02:00
Tomas Votruba
245000a0ce
[DeadCode] Improve unused private property detection (#4430)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-16 21:29:29 +02:00
Tomas Votruba
e085f52f86
[DeadCode] Improve parent and current type comparison on RemoveDelegatingParentCallRector (#4409)
* decouple CurrentAndParentClassMethodComparator

* fix param reflections

* [rector] fix param reflections

* [cs] fix param reflections

* composer: bump assert

* [rector] composer: bump assert

* [cs] composer: bump assert

* static fixes

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-14 17:14:55 +00:00
Abdul Malik Ikhsan
eb1f9c5e32
reactivate coverage report (#4405) 2020-10-14 18:07:59 +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
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
5cb49a2d5a
[PSR-4] Move from FileSystemRector to FileWithoutNamespace node (#4372) 2020-10-08 23:28:24 +02:00
Tomas Votruba
8134a847fe
cs fixes (#4369) 2020-10-07 16:20:53 +02:00
Tomas Votruba
1c8fac5242
Add meta node FileWithoutNamespace (#4355)
* [CakePHP] Promote AppUsesStaticCallToUseStatementRector to File

* [CakePHP] Change ImplicitShortClassNameUseStatementRector to FileWithoutNamespace approach

* [Renaming] Update PseudoNamespaceToNamespaceRector to use FileWithnoutNamespace

* [rector] [Renaming] Update PseudoNamespaceToNamespaceRector to use FileWithnoutNamespace

* [cs] [Renaming] Update PseudoNamespaceToNamespaceRector to use FileWithnoutNamespace

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-05 08:39:02 +00:00
Tomas Votruba
7e124dffc0
[static] replace string attirbutes with contants + fix require rule (#4354)
* replace string attirbutes with contants

* static fixes

* composer: bump sypmlify

* composer: drop branch alias, not usedp
2020-10-04 22:19:25 +00:00
Igor
635e0292c2
Add missing abstract keyword (#4347)
* Remove CheckRequiredAbstractKeywordForClassNameStartWithAbstractRule related error from ignore

* Ignore new PHPStan errors
2020-10-04 22:41:31 +02:00
Tomas Votruba
d0f65ef609
[PHP 8.0] @Required to #[Required] attribute from Symfony 5.2 (#4348)
* move ClassNodeAnalyzer to core

* README: add daily work focus

* spaces

* [PHP 8.0] Add #[Required] Symfony attribute migration

* add RFC links

* [rector] add RFC links

* [cs] add RFC links

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-04 11:12:41 +00:00
TomasVotruba
5453ebfc0e skip cs 2020-10-03 22:09:43 +02:00
Abdul Malik Ikhsan
3ff3e37ecb
[symfony] add AutoWireWithClassNameSuffixForMethodWithRequiredAnnotationRector (#4341)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-02 12:29:18 +02:00
Tomas Votruba
fc48903e97
bump phpstan rules (#4342) 2020-10-02 12:01:53 +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
Abdul Malik Ikhsan
ae816c2c3d
Fixes #4337 : Make Option::SKIP works again with ParameterProvider (#4339) 2020-10-01 18:55:10 +02:00
TomasVotruba
d006788372 drop slam extensions, will be part of symplify 2020-09-25 20:19:53 +02:00
Tomas Votruba
70bf2ea830
[DOCS] Switch DumpRectorCommand from console to string printer (#4281)
* monorepob-builder: add v prefix

* monorepob-builder: add v prefix

* bump symplify

* decouple SymfonyConsole from DumpRectorCommand

* moving to migrify php-config-printer

* regenerate docs

* include rules oerview
2020-09-24 18:54:39 +00:00
Tomas Votruba
7aad4bbf2f
[PHPStan] Enable regex constant rule (#4279) 2020-09-23 11:16:40 +02:00
Tomas Votruba
a73fc88add
[Docs] update docs with node examples (#4269) 2020-09-22 11:27:44 +02:00
Igor
19f700ba4e
[Naming] Factory to create PropertyRename (#4255)
* [Naming] Use factory to create PropertyRename

* Ignore new phpstan issues

* Move fixture to FixtureBasic to solve CI issue

* fix setUp vs dataProvider race condition

* fix autoload

Co-authored-by: TomasVotruba <tomas.vot@gmail.com>
2020-09-21 20:45:43 +00: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
66bf80f891
changed files detector test (#4256)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-18 12:06:01 +02:00
Tomas Votruba
2243583537
[Docs] update docs and type check (#4241) 2020-09-18 11:50:55 +02:00
Tomas Votruba
9bcfb9a3f9
static fixes (#4250)
* composer: update deps

* ignore statics
2020-09-17 19:42:45 +00:00
Tomas Votruba
1950ab5abd
phpstan fixes (#4224) 2020-09-15 11:16:43 +02:00
Abdul Malik Ikhsan
88d5711436
Fixes #3789 add skip Option to exclude files by rule (#4182) 2020-09-12 11:52:08 +02:00
Tomas Votruba
f5f7ba76af
[NoreRepository] merge ClassLikeParsedNodesFinder to NodeRepository (#4185)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-10 14:56:54 +02:00
Tomas Votruba
1a2e9cbb33
static fixes (#4140) 2020-09-07 17:40:46 +02:00
Tomas Votruba
7256dbe667
symplify fixes (#4088)
* notify param/return doc changes

* prevent array doc override
2020-08-31 20:32:33 +00:00
Tomas Votruba
042f08f71b
Drop YAML config support (#4081)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-30 23:29:39 +02:00
Tomas Votruba
ff6d6571e6
[Order] Add abstract class, check for changed order and move category to Class_, to prevent minus types (#4069)
* [Order] report applied rule only on change

* add AbstractConstantPropertyMethodOrderRector, use explicit Class_ and Trait_ over minus

* update docs

* add PropertyNameRankAndPosition value object

* static fixes

* add ClassMethodRankeable and RankeableInterface, to get rid of arrays

* add PropertyRankeable

* add ClassConstRankeable

* add sortByRanksAndGetNames()

* [rector] add sortByRanksAndGetNames()

* [cs] add sortByRanksAndGetNames()

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-30 12:45:03 +00:00
Tomas Votruba
190d7cf616
update ecs (#4048)
* remove array return

* misc
2020-08-28 23:10:00 +02:00
Tomas Votruba
650dcc8ef0
beware reference (#4039) 2020-08-27 12:19:22 +02:00
Tomas Votruba
b4db31a2ae
[DX] Add ReplacedArgument (#4030) 2020-08-26 00:21:41 +02: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
642cda46bd
phpstan config no array (#4014)
* [compiler] use SmartFileSystem

* cleaning sonar from fixtures
2020-08-23 13:53:19 +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