2018 Commits

Author SHA1 Message Date
Tomas Votruba
382f146eaf
Merge CoreRectorInterface (#5762) 2021-03-03 22:28:27 +01:00
Tomas Votruba
c1dab30664
[MockistaToMockery] Drop as mockista is completely dead package (#5758) 2021-03-03 18:40:45 +01:00
Tomas Votruba
c559114715
remove stub loader where not needed (#5757)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-03 17:15:12 +00:00
Tomas Votruba
0a7ce80f4f
[Renaming] Fix importing of just renamed function (#5755)
Co-authored-by: Michal Lulco <lulco@efabrica.sk>
2021-03-03 12:54:03 +00:00
Tomas Votruba
9f96242e8a
[TypeDeclaration] Remove AbstractTypeDeclarationRector (#5753) 2021-03-03 13:27:16 +01:00
Tomas Votruba
516b4b94fa
[Defluent] Remove AbstractFluentChainMethodCallRector (#5751) 2021-03-03 12:57:04 +01:00
Tomas Votruba
98f4554ba2
[Symfony] Remove AbstractToConstructorInjectionRector (#5749) 2021-03-03 11:57:11 +01:00
Abdul Malik Ikhsan
5aa715bb2f
[Symfony4] Handle Ternary with null if in ConsoleExecuteReturnIntRector (#5747) 2021-03-03 10:35:32 +00:00
Tomas Votruba
8cd5d86c03
[Nette] Remove AbstractWithFunctionToNetteUtilsStringsRector (#5746) 2021-03-03 11:30:17 +01:00
Abdul Malik Ikhsan
8430a8d73a
[Symfony4] Skip ConsoleExecuteReturnIntRector on ternary returns number (#5735) 2021-03-03 11:24:17 +01:00
Tomas Votruba
92f2c5b3a6
[Nette] Remove AbstractWithFunctionToNetteUtilsStringsRector (#5742)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-03 09:40:03 +00:00
Abdul Malik Ikhsan
abdc91606d
[Privatization] Skip PrivatizeLocalOnlyMethodRector on use Symfony Route Attribute (#5737)
Co-authored-by: Stephan Vierkant <stephan@vierkant.net>
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-03 10:33:46 +01:00
Abdul Malik Ikhsan
ef6ad7d063
[Naming] Skip UnderscoreToCamelCaseLocalVariableNameRector on used next/prev assign var as ArrayDimFetch (#5741)
Co-authored-by: Alexey Kopytko <alexey@kopytko.com>
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-03 10:32:46 +01:00
Tomas Votruba
b7b6725364
remove abstract (#5736) 2021-03-03 08:49:57 +00:00
Tomas Votruba
3673e2182c
[StaticReflection] Add OptimizedDirectorySourceLocator to speedup directory analysis (#5727)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-02 23:42:53 +00:00
TomasVotruba
c6bf799da4 simplify complexity 2021-03-02 14:44:18 +01:00
Tomas Votruba
d5bf66f9cd
[CI] run rules dir by dir to identify static reflection weak sposts (#5720)
* [CI] run rules dir by dir to identify static reflection weak sposts

* [ci-review] Rector Rectify

* consistency

* remove unused property

* add data provider test fixture

* add InvertedIfFactory to lower complexity

* [DeadCode] Skip unused public method if data provider

* misc

* [DeadCode] Do not remove class method if required by parent ocntract

* make use of ContextAnalyzer to find the loop

* narrow dirs one level

* narrow packages

* narrow

* use directly

* narrow

* correct constant name to keep BC

* bump deps

* add version_compare to removed extra params, just to be sure

* do not return function node on unchanged name

* narrow

* add support for multiple variants

* widen

* remove double check [skip ci]

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-02 14:43:36 +01:00
Abdul Malik Ikhsan
4758dad9b1
[Naming] Handle UnderscoreToCamelCaseLocalVariableNameRector in used in next and previous assign variable (#5718)
* Fixture for UnderscoreToCamelCaseLocalVariableNameRector

See #5715

* try

* fixture

* Closes #5716 Fixes #5715

* final touch

* [ci-review] Rector Rectify

Co-authored-by: Alexey Kopytko <alexey@kopytko.com>
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-01 17:45:54 +01:00
Tomas Votruba
05788745fd
[Downgrade] Remove excessive abstract class inheritance, use single service (#5717) 2021-03-01 12:10:50 +00:00
Tomas Votruba
47743269e8
Removing parent classes (#5714) 2021-03-01 02:28:35 +01:00
Tomas Votruba
da5f4a08c8
remove unmatched errors + require string in object types to avoid prefixing of generics objects (#5713) 2021-03-01 00:56:08 +00:00
addshore
b14ba760e9
[TypeDeclaration] Fixes for array dataProviders with multiple types (#5659)
More changes to PHPUnitDataProviderParamTypeInferer which I think
brings this to completeness in terms of what we want to expect.
2021-03-01 01:46:19 +01:00
Tomas Votruba
8c3443b036
[DX] Removing more parent abstract circular classes (#5709)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-28 15:16:17 +00:00
Abdul Malik Ikhsan
a62bb98fe9
[EarlyReturn] Handle Return Parent next if on ChangeAndIfToEarlyReturnRector (#5711)
* Add failing test fixture for ChangeAndIfToEarlyReturnRector

# Failing Test for ChangeAndIfToEarlyReturnRector

Based on https://getrector.org/demo/aef6b329-49b5-4f27-b23e-9e879a0e2e0b

* Closes #5707

* phpstan

* move find boolean and conditions to NodeRepository

* final touch

Co-authored-by: Markus Staab <maggus.staab@googlemail.com>
2021-02-28 16:07:12 +01:00
Abdul Malik Ikhsan
df101bcbb0
[EarlyReturn] Handle Always return on ChangeAndIfToEarlyReturnRector (#5706) 2021-02-28 13:59:46 +01:00
Tomas Votruba
d737f82d3c
[DX] Add forbidden parent classes (#5705) 2021-02-28 13:53:28 +01:00
Abdul Malik Ikhsan
599df0ab0e
[CodeQuality] Handle Named Argument in ThrowWithPreviousExceptionRector (#5699)
* fixture #5697

* [CodeQuality] Fixes #5697 handle Named Argument in ThrowWithPreviousExceptionRector

* clean up

* ensure named "previous"

* final touch
2021-02-28 10:35:09 +01:00
Tomas Votruba
4909e63a1d
Make use of static reflection from PHPStan (#5665)
* break test without autoload

* PHPStanServiceFactory - add tests directory as analysed paths

* use ReflectionProvider instead of class_exists

* use native reflections for annotation reader

* use native class and method reflections

* add RectorBetterReflectionSourceLocatorFactory

* add DynamicSourceLocator that is shared by PHPStan and Rector

* use ReflectoinProvider instead of class_exists()

* resolve native ClassMethodReflection

* make AnonymousFunctionFactory use reflection

* [DowngradePHP74] Improve DowngradeCovariantReturnTypeRector

* phsptan: avoid ClassReflection

* ProcessCommand: add file infos to source locator

* [DeadCode] Skip RemoveUnusedPublicMethodRector for test

* remove autolaod from tests

* misc

* remove is_a()

* [CI] enable only few dirs to avoid fails

* misc

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-28 08:47:48 +01:00
Abdul Malik Ikhsan
3bb327e797
[Naming] Various Improve RenameForeachValueVariableToMatchExprVariableRector (#5682)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-27 12:32:42 +01:00
Tomas Votruba
c7b76c4983
[DX] Narrow wobly strings to strict ObjectType() #2 (#5694)
* use direct call on isObjectTypes()

* make use of ObjectType over strings
2021-02-27 02:13:22 +00:00
Tomas Votruba
0e7b845789
[DX] Narrow wobly strings to strict ObjectType() (#5693)
* [Renaming] Remove support for wildcards in method rename, to keep consistency and use of PHPStan ObjectType

* [DX] Use ObjectType instead of strings

* make isObjectTypes() require ObjectType

* decoupled SelfContainerFactory

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-27 00:58:09 +00:00
Tomas Votruba
a61a2c6e5e
use getNodeTypes() with class-string generic type (#5692)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-27 00:06:15 +00:00
Abdul Malik Ikhsan
8604151f7f
[CodingStyle] Skip RemoveUnusedAliasRector on used in ClassConstFetch (#5691) 2021-02-26 18:18:14 +01:00
Abdul Malik Ikhsan
38e8520635
[NodeTypeResolver] Handle object type or nullable object type from Parameter as Identifier (#5686) 2021-02-26 10:39:07 +01:00
Abdul Malik Ikhsan
be554a4a53
[EarlyReturn] Add ReturnBinaryOrToEarlyReturnRector (#5661)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-25 09:41:43 +01:00
Abdul Malik Ikhsan
5caae361e8
[Naming] Add RenameForeachValueVariableToMatchExprVariableRector (#5672)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-25 09:38:30 +01:00
Abdul Malik Ikhsan
9a30a743a9
[DeadDocBlock] Skip RemoveUselessReturnTagRector on Generic Type (#5675) 2021-02-25 09:37:18 +01:00
Abdul Malik Ikhsan
105e2e7026
[DeadDocBlock] Skip RemoveUselessParamTagRector on Generic Type (#5677)
Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
2021-02-25 09:36:33 +01:00
Abdul Malik Ikhsan
8ccef95979
[Privatization] Skip PrivatizeLocalOnlyMethodRector on use of SymfonyRouteTagValueNode (#5671)
* [Privatization] Fixes #5670 Skip PrivatizeLocalOnlyMethodRector on use of SymfonyRouteTagValueNode

* fixture

* [ci-review] Rector Rectify

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-24 16:21:11 +01:00
addshore
68ed2eaa7c
[TypeDeclaration] Add types when dataProviders that yield are used (#5625)
Followup to https://github.com/rectorphp/rector/pull/5615
which fixed behaviour for regular dataProviders
2021-02-23 16:30:42 +01:00
Abdul Malik Ikhsan
eecf15dc15
[DeadCode] Add Extra files test for RemoveEmptyAbstractClassRector (#5598)
Co-authored-by: TomasVotruba <tomas.vot@gmail.com>
2021-02-23 15:28:41 +00:00
Abdul Malik Ikhsan
a474ee23f4
[EarlyReturn] Skip ReturnAfterToEarlyOnBreakRector on non-linear previous assignment before foreach (#5660)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-23 11:47:52 +01:00
Tomas Votruba
cabe032008
[static] Improve types (#5657)
Co-authored-by: Ruud Kamphuis <ruudk@users.noreply.github.com>
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-23 01:25:34 +00:00
Tomas Votruba
9514a2531f
use RequireStringArgumentInConstructorRule (#5656)
Co-authored-by: Ruud Kamphuis <ruudk@users.noreply.github.com>
2021-02-22 22:15:33 +01:00
Tomas Votruba
5ba33240ca
Bump to Symplify 9.2.1 (#5655) 2021-02-22 20:05:33 +00:00
Abdul Malik Ikhsan
cbbd008f50
[EarlyReturn] Skip PreparedValueToEarlyReturnRector on previous var used in Assign Expr in if stmt (#5650) 2021-02-22 11:01:01 +01:00
Abdul Malik Ikhsan
6ebecd91b0
[Php80] Handle Nullable Type on ClassPropertyAssignToConstructorPromotionRector (#5644) 2021-02-22 10:59:51 +01:00
Tomas Votruba
72d6f1ab86
cleanup unneeded AbstractTemporaryRector methods (#5648) 2021-02-21 23:39:53 +00:00
Abdul Malik Ikhsan
db5f557947
[Php80] Skip ChangeSwitchToMatchRector on missed break (#5645) 2021-02-21 15:34:57 +01:00
Tomas Votruba
e571128b85
[Transform] Move FunctionCallToConstantRector to FuncCallToConstFetchRector (#5642) 2021-02-21 09:40:54 +00:00