10287 Commits

Author SHA1 Message Date
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
3ed76c6559
[Nette] Add RemoveParentAndNameFromComponentConstructorRector (#4515)
* [Nette] Add RemoveParentAndNameFromComponentConstructorRector

* add refactorClassMethod()

* add refactorStaticCall()

* add refactorNew() method

* [Nette] Rename AddDatePickerToDateControlRector to AddNextrasDatePickerToDateControlRector

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-30 17:10:17 +00: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
Tomas Votruba
b369c3da95
[ci] use composer v2 for rector_ci (#4513) 2020-10-30 14:50:38 +01:00
Tomas Votruba
b302e493dd
[SOLID] Add MoveVariableDeclarationNearReferenceRector (#4410)
* Create test cases

* Create rector

* Add closure to possible parent scopes

* Register in SOLID set

* Document the feature

* fix adding variable in closure

* move MoveVariableDeclarationNearReferenceRector to Assign category, based on getNodeTypes()

* ci: drop phpunit matcher, not much helpful

* ignore for now, many cases to cover

* prepare release

Co-authored-by: Anna Filina <afilina@gmail.com>
2020-10-30 13:25:24 +00:00
Abdul Malik Ikhsan
49b7635b27
[Performance] Bug Fix CountArrayToEmptyArrayComparisonRector for negation inside or / and operator (#4508)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-30 14:09:18 +01:00
Tomas Votruba
dc2047f70a
[TypeDeclaration] Switch from stringy types to PHPStan types (#4510)
* nette-30 config cleanup

* [TypeDeclaratoin] Move AddReturnTypeDeclarationRector from generic

* add Type support to AddReturnTypeDeclaration

* make AddParamTypeDeclarationRector use PHPStan type objects over strings

* [SymfonyPhpConfig] Add support for nested types

* drop StringTypeToPhpParserNodeMapper

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-30 11:58:35 +00:00
Tomas Votruba
63037fe924
[DynamicTypeAnalysis] Drop for too theoretical content, needs real project to test out (#4511) 2020-10-30 00:30:10 +00:00
Tomas Votruba
7da47f444b
[ci] automated rebase experiment (#4498)
* [ci] automated rebase experiment

* fixup! [ci] automated rebase experiment

* fixup! fixup! [ci] automated rebase experiment
2020-10-29 23:14:17 +01:00
Tomas Votruba
bc41ba2b2e
phpstan cleanup (#4509)
* move tag objects to ValueObject namespace

* [ci] temporarily disable weird broken monorepo split, wait for move to github actoins
2020-10-29 23:06:26 +01:00
Tomas Votruba
5d190a3d55
phpstan cleanup config (#4507) 2020-10-29 21:34:51 +00:00
Tomas Votruba
5361a304b2 fix name 2020-10-29 22:26:42 +01: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
a2ae659e0a
[CodeQualityStrict] Enable MoveOutMethodCallInsideIfConditionRector (#4502)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-29 21:47:12 +01: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>
0.8.45
2020-10-29 19:04:33 +01:00
Tomas Votruba
252f17821e
fix non-existing method trying to get method reflection (#4505) 2020-10-29 16:45:13 +00:00
Tomas Votruba
35804361aa
[docs] decouple pages from README (#4501) 2020-10-29 10:44:07 +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
2116630748
[ci] remove old merageable file (#4497)
* [ci] remove old merageable file

* updat ecs
2020-10-28 23:26:17 +00:00
Tomas Votruba
9314c4b173 fix cs 2020-10-28 23:03:13 +01:00
Abdul Malik Ikhsan
c54377da25
[Performance] Add CountArrayToEmptyArrayComparisonRector (#4489)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-28 22:59:21 +01:00
Raffael Comi
2e44469c94
Return also explicitly mixed types in IdentifierTypeMapper (#4483) 2020-10-28 21:51:56 +01:00
Tomas Votruba
2243a81445 [ci] add fix for missing secrets in 3rd party forks 2020-10-28 21:47:56 +01:00
Tomas Votruba
4d4def62d1 [ci] add fix for missing secrets in 3rd party forks 2020-10-28 21:47:29 +01:00
Raffael Comi
7bd20258bc
Map iterable in ScalarStringToTypeMapper (#4482)
* Map iterable in ScalarStringToTypeMapper

* Add test
2020-10-28 21:42:17 +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>
0.8.44
2020-10-27 15:51:44 +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
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
Tomas Votruba
a6e85fe69a
[PHPUnit] Fix AddSeeTestAnnotationRector for same short name, but different namespace (#4488)
* [PHPUnit] Fix AddSeeTestAnnotationRector for same short name, but different namespace

* correct namespaces
0.8.43
2020-10-27 00:42:04 +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
20e95bee61
[CI] Run ECS only on match git diff (#4487)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-26 12:28:32 +01:00
Tomas Votruba
2e86dc5876 colors to ci 2020-10-26 11:53:57 +01:00
Tomas Votruba
80d688413d fix stan 2020-10-26 11:44:06 +01:00
Tomas Votruba
5f3b4bde1f
[Naming] Allow does in MakeIsserClassMethodNameStartWithIsRector (#4486) 2020-10-26 10:22:20 +00:00
Tomas Votruba
0d6b5aea7a kodiak: update branches with tagp 2020-10-26 01:41:07 +01:00
Tomas Votruba
f6fc2f8750 kodiak: update branches 2020-10-26 01:36:14 +01:00
Tomas Votruba
9c91a60018
[ci] add ci-review job (#4484)
* [ci] add ci-review job

* add all

* [ci] add docs check

* [ci] simler rector ci
2020-10-26 00:14:24 +00:00
Tomas Votruba
6f56d0dfbe
[docs] apply correct standard on dumper Rector list + apply automated CI commit on propagate monorepo deps (#4481) 2020-10-26 00:22:53 +01:00
Tomas Votruba
0b2688464f
Travis: use composer 1 to fix bug with psr packages 2020-10-25 17:19:21 +01:00
Jan Mikeš
d864005904
Fix not provided --output-file argument translated into string instead of null (#4480)
* Fix not provided --output-file argument translated into string instead of null
Fixes #4456

* [rector] Fix not provided --output-file argument translated into string instead of null Fixes #4456

* [cs] Fix not provided --output-file argument translated into string instead of null Fixes #4456

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-25 15:26:01 +01:00
Tomas Votruba
bdf9464d25 skip bugged phpstan file 2020-10-25 14:56:11 +01:00
Tomas Votruba
2fc46fde21 ci: use compsoer v1 2020-10-25 14:49:56 +01:00
Tomas Votruba
0f2e6d407e
[DoctrineAnnotaitonGenerated] Update to doctrine/annotations 1.11 + fix static (#4479) 2020-10-25 14:43:05 +01:00
Tomas Votruba
5bb03f2fcb composer: bump symplify dpes 0.8.42 2020-10-25 01:20:14 +02:00
Abdul Malik Ikhsan
11c76808be
[CodeQuality] Add MoveOutMethodCallInsideIfConditionRector (#4457)
* Add MoveOutMethodCallInsideIfConditionRector

* cs fix

* implemented handling pass constant to arg 0

* phpstan

* final touch: no need strtolower() before ucfirst on fallback var name
2020-10-23 15:15:54 +02:00
Abdul Malik Ikhsan
be06b60eac
Typo Fix: Strings::endWith() should be Strings::endsWith() (#4475)
* Typo Fix: Strings::endWith() should be Strings::endsWith()

* [rector] Typo Fix: Strings::endWith() should be Strings::endsWith()

* [cs] Typo Fix: Strings::endWith() should be Strings::endsWith()

* phpstan

* [rector] phpstan

* [cs] phpstan

* cs fix

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-23 11:23:12 +02:00
Tomas Votruba
6c51f3fb4f
[Restoration] Add InferParamFromClassMethodReturnRector (#4471)
Co-authored-by: rector-bot <tomas@getrector.org>
0.8.41
2020-10-21 23:06:24 +02:00
Tomas Votruba
10ae0d687a
[CodeQuality] Add NewStaticToNewSelfRector (#4468)
* [CodeQuality] Add NewStaticToNewSelfRector

* regenerated docs

* drop patches
0.8.40
2020-10-20 22:01:47 +00:00
TomasVotruba
4fc93376c6 typo fi 0.8.39 2020-10-20 23:34:05 +02:00