10841 Commits

Author SHA1 Message Date
Michal Lulco
c6ab3bf015
Added missing symfony/process to composer.json (#5264) 2021-01-20 15:12:17 +01:00
Jan Lohage
8d6f8369f1
NodeFactory: Allow passing a Cast node to createArrayItems (#5263)
Allow passing a Cast node to createArrayItems
2021-01-20 15:12:00 +01:00
TomasVotruba
6dd74ffb89 remove unused sniff 0.9.11 2021-01-20 15:05:20 +01:00
Tomas Votruba
f4eb05998b
extend Nette 3.1 set (#5261) 2021-01-20 13:08:23 +00:00
Abdul Malik Ikhsan
c2c5228199
[TypeDeclaration] Improve FlipTypeControlToUseExclusiveTypeRector : add Nullable support for Assign expr (#5254)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-20 11:41:35 +00:00
Abdul Malik Ikhsan
d5fc2cb8f5
[DeadCode] Skip RemoveUnusedPublicMethodRector on __construct (#5258)
* Add failing test fixture for RemoveUnusedPublicMethodRector

# Failing Test for RemoveUnusedPublicMethodRector

Based on https://getrector.org/demo/48213d30-8e42-4f9f-885b-30906a78970f

#5256

* Close #5257 Fixes #5256

Co-authored-by: Jan Lohage <j2L4e@users.noreply.github.com>
2021-01-20 12:19:11 +01:00
Michal Lulco
f386ccd8ce
Upgrade to Nette 3.1 (#5195) 2021-01-20 12:17:16 +01:00
Tomas Votruba
5e882a711c
Drop php doc info visitor (#5250)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-20 00:36:35 +01:00
Tomas Votruba
34168ff9d8
various cherry picks (#5248) 2021-01-19 23:29:52 +00:00
Tomas Votruba
05356b393a
Getting rid of attribute (#5246)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-19 22:32:28 +01:00
Tomas Votruba
81eeb2771b
Various cherry-pick (#5243)
* [Transform] Add VariableMethodCallToServiceCallRector

* use direct phpdocinfo

* cleanup

* narrow DoctrinePropertyAnalyzer

* misc
2021-01-19 20:39:57 +00:00
Tomas Votruba
4b7f6f4a72
use PhpDocTagRemoer as a service (#5242)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-19 19:45:30 +00:00
Tomas Votruba
66d0b61a9d
[Comments] Decouple new package (#5239)
* [Comments] Decopule new package

* fix RemoveNonExistingVarAnnotationRector

* decopule PropertyFetchFinder

* misc

* fix fixed printer

* fix import

* remove dead code

* fix comparing nodes with tokens instead of identical compare

* remove complexity

* decouple IndentCharacterDetector

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-19 19:11:10 +00:00
Tomas Votruba
133322cc65
cherry pick (#5238)
* misc

* decopule DocBlockManipulator misc

* make use static instnaceof

* add markAsChanged() to PhpDocInfo

* decopule DocBlockTagReplacer

* change static annotation naming to service

* misc
2021-01-19 15:03:26 +00:00
Jarek Jakubowski
477ccbb2ba
Fix parsing JoinTable without table name explicitly set (#5236) 2021-01-19 15:46:38 +01:00
Abdul Malik Ikhsan
6b196a96ea
[TypeDeclaration] Register FlipTypeControlToUseExclusiveTypeRector to type-declaration set (#5223)
Co-authored-by: rector-bot <tomas@getrector.org>
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2021-01-19 12:24:48 +01:00
Abdul Malik Ikhsan
14def70268
[PHPStan] Clean up duplicate PHPStan config (#5232)
* [PHPStan] Clean up PHPstan config

* phpstan

* phpstan
2021-01-19 12:19:20 +01:00
Tomas Votruba
bbe758ab60
phpdoc info refactor part 4 (#5231)
* remove useless docblocks

* misc

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-19 01:15:32 +00:00
Tomas Votruba
ad9448018c
[PhpDocInfo Decouple] Use php doc info from factories, not from attribute (#5229)
* use single method to create docs

* use phpDocInfoFactory instead of getAttribte php doc info in Rectors

* move callig to phpDocInfoFactory

* misc
2021-01-18 21:45:13 +00:00
Tomas Votruba
b9bc05aa44
[PhpDocInfo Decopule] Refactor PhpDocTypeChanger outside the value object (#5226)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-18 20:06:02 +00:00
Tomas Votruba
147f86c62d
add FalseBooleanType and UnionType false support (#5228)
* add FalseBooleanType

* fix boolean union types

* fix nullable union type on old versoin

* decouple BoolUnionTypeAnalyzer

* [ci-review] Rector Rectify

* decopule

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-18 19:23:10 +00:00
Abdul Malik Ikhsan
2e911431e9
[PHPStan] Fix duplicate report PreventDuplicateClassMethodRule (#5225)
* [PHPStan] Fix duplicate report PreventDuplicateClassMethodRule

* reg
2021-01-18 17:46:10 +01:00
Tomas Votruba
a7550337f0
Add promoted property in PHP 8.0, when adding a ctor dependency (#5222)
* add PHP 8.0 test

* Add promoted property adding in constructor injection on PHP 8

* update tests to use propert promotion

* fix promoted property adding

* decopule Doctrine registry to manager

* shorter naming

* fix parent ctor completion

* nette promotion fixes

* fixes

* fix property inject

* misc

* misc
2021-01-18 13:09:48 +00:00
Abdul Malik Ikhsan
3c2f4eae47
[TypeDeclaration] Add FlipTypeControlToUseExclusiveTypeRector (#5214)
* [TypeDeclaration] Fixes #5137 [WIP] Add FlipTypeControlToUseExclusiveTypeRector

* adding test

* checking types

* define instanceof

* define instanceof

* refactor use Identical node

* functional

* phpstan

* rectify

* BooleanNot

* phpstan

* skip not null compare

* skip no assign

* skip no var tag

* skip multi types

* skip assign different var

* test interface type

* skip not null doc

* skip array

* skip no doc

* skip not union

* cs fix

* cs fix

* fix example

Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>

* remove doc as well

* cs

* cs

* cs

* phpstan

* clean up

* use instanceof IdentifierTypeNode check

* failing fixture skip string type

* Revert "use instanceof IdentifierTypeNode check"

This reverts commit aa046dff740b621e881d27e3a51e3a3a3c73a59c.

Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2021-01-18 13:22:26 +01:00
Tomas Votruba
e8ec95fe85
skip anything but variable (#5221) 2021-01-18 11:47:39 +01:00
Tomas Votruba
7b72a07894
[Transform] Add NewToConstructorInjectionRector (#5220)
* [Transorm] Add NewToConstructorInjectionRector

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-18 10:44:07 +00:00
Tomas Votruba
5105fd0355
[Composer] Remove forgotten validation (#5219)
* [Composer] Remove forgotten validation

* skip duplicated method
2021-01-18 10:07:57 +00:00
Tomas Votruba
4d6d2cd440
[PHP 8.0] Remove union types doc if useless (#5217)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-18 02:56:12 +01:00
Tomas Votruba
cfbe014d67
[PHP 7.3] Fix stirng retype on intersections (#5216)
* [PHP 7.3] Fix stirng retype on intersections

* remove unneeded command layer for showing not enough args

* make sure there is application

* misc
2021-01-17 23:39:13 +00:00
TomasVotruba
120e857606 [PHP 8.0] Drop FalseableCountToZeroRector, not used anymore 2021-01-17 22:36:37 +01:00
TomasVotruba
5f975f48f6 [DeadCode] Skip unused class constant in case of api on class 0.9.10 2021-01-17 20:30:11 +01:00
TomasVotruba
e5226b87da cleanup commented code 2021-01-17 16:50:28 +01:00
Tomas Votruba
ea1f7bd758
Lower class complexity (#5208)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-17 15:43:47 +00:00
Tomas Votruba
0a3dc08d61
drop Sonarcube (#5215) 2021-01-17 15:32:01 +00:00
github-actions[bot]
d93900b56a
[automated] Re-Generate Nodes/Rectors Documentation (#5211)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2021-01-17 14:32:41 +01:00
github-actions[bot]
8d00d33505
[automated] Re-Generate CHANGELOG.md (#5212)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2021-01-17 14:32:31 +01:00
Abdul Malik Ikhsan
a071ae7dff
[CodeCoverage] Fixes weekly code coverage by move COVERALLS_REPO_TOKEN on run (#5213) 2021-01-17 14:31:55 +01:00
Tomas Votruba
024a97d019
[RemovingStatic] Decouple static (#5207)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-16 22:45:18 +01:00
Tomas Votruba
c0105bde25
Change maximal Rector complexity to 35 to avoid hard coupling to Rector classes (#5206)
* complexity

* decopule GetSubscriberEventsClassMethodFactory and ListenerServiceDefinitionProvider

* decopule UnusedParameterResolver, AssertMethodCallFactory, PropertyFetchWithVariableReplacer

* decopule ParamAndArgFromArrayResolver

* decopule JsonArrayFactory and JsonEncodeStaticCallFactory

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-16 19:11:11 +00:00
Tomas Votruba
83d2e1843f
[PHP 8.0] Remove var doc, if not useful (#5204)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-16 17:45:12 +01:00
Tomas Votruba
04db98620a
Refactor composer modifier to ComposerRector (#5198) 2021-01-16 13:23:37 +01:00
Abdul Malik Ikhsan
35e83f75c6
[Utils] Add validate-fixture-filename command (#5199)
* [Utils] Add validate-fixture-filename command

* register command

* fix existing fixture filename with -

* clean up
2021-01-16 13:19:40 +01:00
Abdul Malik Ikhsan
4b887f863f
[DeadCode] Register RemoveDeadConditionAboveReturnRector to dead-code config set (#5197)
* [DeadCode] Register RemoveDeadConditionAboveReturnRector to dead-code config set

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-16 11:58:24 +01:00
Abdul Malik Ikhsan
14d89dd78f
[CodeQualityStrict] Skip MoveVariableDeclarationNearReferenceRector on assign expr is ArrayDimFetch (#5201)
* [CodeQualityStrict]Fixes #5200 Skip MoveVariableDeclarationNearReferenceRector on assign expr is ArrayDimFetch

* fixture

* phpstan

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-16 11:55:28 +01:00
Abdul Malik Ikhsan
cf142b3f06
[Exclusion] Move SomeRector class to under Tests (#5202) 2021-01-16 11:53:54 +01:00
Tomas Votruba
c2999b5db2
[Composer] Fix value object inliner with Version (#5196)
Co-authored-by: Michal Lulco <lulco@efabrica.sk>
2021-01-15 23:07:52 +00:00
Tomas Votruba
56409c5a3a
[phpstan] Remove unreported errors and duplicated methods (#5193)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-15 21:27:36 +01:00
Abdul Malik Ikhsan
ac677c9f3e
[DeadCode] Add RemoveDeadConditionAboveReturnRector (#5194)
* [DeadCode][WIP] Fixes #4925 Add RemoveDeadConditionAboveReturnRector

* apply

* functional

* skip prev not if

* skip prev has elseif

* skip prev has else

* skip prev has multi stmt

* skip prev not return

* skip prev different return

* cs fix

* class name fixture fix

* skip prev empty stmt

* remove prev empty stmt

* add different cond
2021-01-15 20:16:44 +01:00
Jan Lohage
deafb51503
(fix) RemoveDoubleAssignRector: properly skip if the assigned expression is a call (#5191) 2021-01-15 16:13:02 +01:00
Abdul Malik Ikhsan
96986b5edb
[PHPStan] Clean up duplicated ignore error "Class cognitive complexity is \d+, keep it under 40" in phpstan.neon (#5192) 2021-01-15 16:12:56 +01:00