10818 Commits

Author SHA1 Message Date
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
Tomas Votruba
7f3cfd93e8
[Privatization] Fix another get class (#5190) 2021-01-15 00:26:37 +00:00
Tomas Votruba
0be8a9c2ca
[Naming] Fix const fetch missed class name bug (#5189)
* [Naming] Fix const fetch missed class name bug

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
0.9.9
2021-01-15 01:13:31 +01:00
Tomas Votruba
58d97b9853
[Naming] Fix Param type Promoted Rename (#5188)
* [Naming] Make RenameParamToMatchTypeRector skip promoted property

* [Naming] Add property rename to RenamePropertyToMatchTypeRector

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
0.9.8
2021-01-14 22:44:07 +00:00
Abdul Malik Ikhsan
55ee86cb90
[Docker] Install libicu-dev to allow install intl (#5186)
* [Docker] Install libicu-dev to allow install intl

* phpstan
2021-01-14 17:56:23 +01:00
Kevin EMO
c1976251f8
[Typo] Fixed a typo in the README.md file (#5187)
:)
2021-01-14 17:55:53 +01:00
Abdul Malik Ikhsan
4d3ed9e1de
[Docker] Fixing configure - install - enable intl (#5185)
* [Docker] Fixing configure - install - enable intl

* no need enable, only configure and install
2021-01-14 14:11:37 +01:00
Henk Poley
e0b9c143a0
Issue #5180 - add intl extension (#5184)
https://github.com/rectorphp/rector/issues/5180#issuecomment-760100459
2021-01-14 12:31:34 +00:00
Tomas Votruba
1cd0e1004f
add missing astral package (#5182) 2021-01-14 12:03:13 +00:00
github-actions[bot]
fc9acd9c21
[automated] Re-Generate Nodes/Rectors Documentation (#5178)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2021-01-14 11:10:33 +01:00
TomasVotruba
72d01fea03 [ci] move cs and doc check to once a week 2021-01-14 11:10:03 +01:00
Abdul Malik Ikhsan
8a739f2ce6
[DeadCode] Failing fixture remove unused variable assign in expr (#5165)
* [DeadCode] Failing fixture remove unused variable assign in expr

* Fix #5152

* fixture namespace fix-a

* cs fix

* ensure type of expr is one of FuncCall,MethodCall,StaticCall,NullsafeMethodCall,or New_

* fixture skip multi args

* phpstan

* skip in expr
2021-01-14 11:07:38 +01:00
Abdul Malik Ikhsan
09118247d3
[CodeQuality] Improve SimplifyDeMorganBinaryRector : skip not "or" operator (#5177)
* [CodeQuality] Improve SimplifyDeMorganBinaryRector : skip not "or" operator

* fixture

* cs fix

* clean up
2021-01-14 01:54:44 +01:00
Jan Kiesewetter
e09d2ab0ab
Clear apt and composer cache after installing (#5173) 2021-01-14 01:45:14 +01:00
bruce aldridge
21caa47d38
Add failing test fixture for EncapsedStringsToSprintfRector (#5176)
# Failing Test for EncapsedStringsToSprintfRector

Based on https://getrector.org/demo/197507f8-e9cb-4f9c-8aa1-b08702496253
2021-01-14 01:43:50 +01:00
Tomas Votruba
0f4da846a5
[SymfonyCodeQuality] Prevent route class override, add support for start with numbers (#5172) 0.9.7 2021-01-13 14:55:04 +00:00
Tomas Votruba
713915d1b2
Polishing composer rules (#5170)
* [Composer] Add check for existing compsore.json

* update composer package

* coding style

* various static fixes
2021-01-13 13:02:14 +00:00
Tomas Votruba
96e44124cc
[Composer] Add check for existing compsore.json (#5168) 2021-01-13 11:56:24 +00:00
Abdul Malik Ikhsan
fa1b904f36
[CodeQuality] Skip SimplifyDeMorganBinaryRector on negated greater or equal (#5164)
* [CodeQuality] Fixes #5153 Skip SimplifyDeMorganBinaryRector on negated greater or equal

* fixture

* fixture

* fixture class name fix

* add missing fixture namespace
2021-01-13 12:48:46 +01:00
Abdul Malik Ikhsan
40c54eb1f4
[PHPUnit] Migrate phpunit.xml configuration with --migrate-configuration (#5166)
* [PHPUnit] Migrate phpunit.xml configuration with --migrate-configuration

* 4 spaces and indent
2021-01-13 12:30:23 +01:00
Tomas Votruba
7d9fa07c72
import const name attribute (#5158)
* use config over manual creationg

* add attribute test
2021-01-13 01:44:48 +00:00
github-actions[bot]
19c47b9f1f
[automated] Re-Generate Nodes/Rectors Documentation (#5162)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2021-01-13 02:25:45 +01:00
Michal Lulco
3840fb4135
Added usage of composer modifier for nette upgrade to 3.0 (#5161) 2021-01-13 00:23:45 +01:00
Michal Lulco
4bd4a4657b
Full upgrade of codebase including changes in composer.json (#5074)
* Composer changer

* Implemented ChangePackage, ChangePackageVersion and RemovePackage with tests

* Refactored composer processor

* Refaktoring

* Added missing tests

* Added void return type to test

* Changed namespaces and fixed CI tests

* Apply rector rules

* Moved new line to processor from modifier

* Use array copies in tests

* Added descriptions to all construct parameters and inheritDoc to modify methods

* Rewritten ComposerModifierTest to use AbstractKernelTestCase and ComposerModifier as service

* Split MovePackage to 2 classes

* Sort packages if it is set in config

* Rectified

* Rename class ChangePackage to ReplacePackage

* Split class AddPackage to AddPackageToRequire and AddPackageToRequireDev

* Added Version checker and moved modifier classes to separated folder

* Changed array to ComposerJson in modify methods

* Rectifying

* Removed unnecessary docs

* Temporary added fork of composer-json-manipulator

* Removed unused code and replaced InvalidArgumentException to assert
2021-01-12 22:50:42 +01:00