145 Commits

Author SHA1 Message Date
TomasVotruba
f91ce82066 add one missing in whole family 2021-04-24 09:35:30 +02:00
Tomas Votruba
9e869098ff
[Downgrade PHP 7.2] Fix 2+ param position (#6227) 2021-04-24 07:13:59 +00:00
Tomas Votruba
aa2c142038
[Downgrade PHP 7.2] Cover nullable param in DowngradeParameterTypeWideningRector (#6225) 2021-04-24 00:53:17 +00:00
Tomas Votruba
fa45c4f9d1
[Downgrade PHP 7.2] Make DowngradeParameterTypeWideningRector work for interface (#6224) 2021-04-24 01:14:40 +02:00
Tomas Votruba
793dd3fd2e
[Downgrade PHP 7.1] Fix empty item on SymmetricArrayDestructuringToListRector (#6222)
* [Downgrade PHP 7.1] Fix empty item on SymmetricArrayDestructuringToListRector

* [ci-review] Rector Rectify

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-23 22:28:00 +02:00
Tomas Votruba
f9dc93cb1a
Fix WrapEncapsedVariableInCurlyBracesRector reporting (#6220)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-23 19:32:59 +00:00
Tomas Votruba
a3ec81fe1f
Add setter/getter factory (#6219) 2021-04-23 18:14:51 +00:00
Tomas Votruba
ab6580de35
[Downgrade PHP 7.2] Make covariant change local methods only (#6218) 2021-04-23 17:54:30 +00:00
Tomas Votruba
e425c11d8d
[Downgrade PHP 7.2] Improve covariant (#6207) 2021-04-23 09:03:45 +00:00
Abdul Malik Ikhsan
91377902b2
[DowngradePhp70] Add DowngradeNullCoalesceRector (#6208) 2021-04-23 09:21:57 +02:00
TomasVotruba
86c3069f36 [Downgrade 7.2] Add string has/get interface 2021-04-23 01:00:33 +02:00
Tomas Votruba
1d0ba2a439
Add AbstractTestCase (#6205) 2021-04-22 21:36:50 +00:00
Abdul Malik Ikhsan
cb6e874df3
[DeadCode] Skip expr check from statement on RemoveUnusedVariableAssignRector for Nop stmt (#6204)
* [DeadCode] Skip expr check from statement on RemoveUnusedVariableAssignRector for Nop stmt

* enforce with Expression check

* [ci-review] Rector Rectify

* fix

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-22 15:44:33 +00:00
Abdul Malik Ikhsan
60195c951a
[DowngradePhp71] Add DowngradeIsIterableRector (#6202)
* [DowngradePhp71] Add DowngradeIsIterableRector

* add test

* return new BooleanOr

* [ci-review] Rector Rectify

* fixed with traverseNodesWithCallable

* skip not is iterable

* fix

* example

* register to downgrade-php71 config set

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-22 13:22:16 +00:00
Tomas Votruba
ce4711ba93
[Downgrade] Report downgrade changes of type correctly (#6203) 2021-04-22 13:10:04 +00:00
Ruud Kamphuis
40c0f3f0c0
[UnionTypesRector] Do not refactor inherited methods (#6201)
# Failing Test for UnionTypesRector

Based on https://getrector.org/demo/6298a30b-d9f5-4fa0-b1f8-9712b0e98582

```
PHP Fatal error:  Declaration of Child::enqueueAt(DateTime|int $at) must be compatible with SomeParent::enqueueAt($at)
```
2021-04-22 14:47:25 +02:00
Ruud Kamphuis
f17df67963
[TypedPropertyRector] Do not refactor to iterable property type (#6196)
# Failing Test for TypedPropertyRector

Based on https://getrector.org/demo/3a8fc4f5-898d-4fb4-8ed3-99dc8312df77

```
Fatal error: Cannot use iterable as iterable because 'iterable' is a special class name
```
2021-04-22 14:20:04 +02:00
Ruud Kamphuis
38871e68a2
[TypedPropertyRector] Do not refactor to callable property type (#6197)
# Failing Test for TypedPropertyRector

Based on https://getrector.org/demo/e8724b53-a00c-4f0c-b10f-e4e54be0a664

```
PHP Fatal error:  Property SkipCallablePropertyType::$startDate cannot have type DateTimeImmutable|callable
```
2021-04-22 14:19:24 +02:00
Tomas Votruba
45db3289b9
Fix type (#6200) 2021-04-22 11:58:54 +00:00
Tomas Votruba
ff57c49662
[PHP 7.2] Add covariant param support for trait methods (#6190)
* [Downgrade PHP 7.2] Handle trait methods too

* move DowngradeParameterTypeWideningRector to Class_ namespace

* [ci-review] Rector Rectify

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-22 00:02:38 +02:00
Tomas Votruba
4dfd6df447
[TypeDeclaration] Skip exception on void (#6182) 2021-04-20 19:50:10 +00:00
Tomas Votruba
d723aca946
[TypeDeclaratio] Skip abstract method in AddVoidReturnTypeWhereNoReturnRector (#6173) 2021-04-20 12:41:41 +00:00
Abdul Malik Ikhsan
cd3725aeb5
[DowngradePhp71] Add DowngradeKeysInListRector (#6170)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-20 14:21:02 +02:00
Tomas Votruba
eda5bf1ea3
[DeadCode] Add RemoveUnusedPrivateMethodParameterRector (#6168)
* [DeadCode] Add RemoveUnusedPrivateMethodParameterRector

This reverts commit c815334bed781c555f08dff82ce7861d758e9e7a.

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-19 15:19:14 +02:00
Joyce Babu
49d4f71214
Fix #6161 (#6166) 2021-04-19 11:02:12 +00:00
Abdul Malik Ikhsan
fa6fc49c59
[NodeAnalyzer] Use ClassAnalyzer for anonymous class check (#6162)
* use ClassAnalyzer in ParsedNodeCollector

* use ClassAnalyzer in BetterNodeFinder

* use Pin ParentClassToTraitsRector

* use in ChangeSingletonToServiceRector

* use in ValueObjectClassAnalyzer

* use in PropertyAddingPostRector

* use in fixture

* use isAnonymous() in ClassAnalyzer
2021-04-18 15:01:22 +02:00
Tomas Votruba
e8a76e8f2b
Do not prefix "parent", "self", "static" and native constants (#6159)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-17 12:09:58 +00:00
Abdul Malik Ikhsan
2b22e73efd
[DeadCode] Skip Variable Variable $$var on RemoveUnusedVariableAssignRector (#6156) 2021-04-16 12:14:05 +02:00
Abdul Malik Ikhsan
d4bb85bdc7
[DeadCode] Skip RemoveUnusedVariableAssignRector on next expr Include_ (#6153)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-16 11:18:07 +02:00
SWalther
7bf3eeb61d
[DEAD-CODE] Added failing ShadowedLocalVariable test and implementation (#5996)
Co-authored-by: clxswalther <swalther@complex.it.de>
Co-authored-by: fbecker-complex <71324952+fbecker-complex@users.noreply.github.com>
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2021-04-15 22:27:56 +00:00
Tomas Votruba
101041d6ae
[DeadCode] Remove RemoveDefaultArgumentValueRector (#6148) 2021-04-16 00:11:58 +02:00
Tomas Votruba
268b32ff7e
[DeadCode] Remove duplicated RemoveUnusedPrivateConstantRector (#6151)
* [DeadCode] Remove duplicated RemoveUnusedPrivateConstantRector

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-15 23:38:44 +02:00
TomasVotruba
d3295a7d1e fix incorrect varialbe name 2021-04-15 23:07:07 +02:00
Rob Landers
27f3544e8e
Fix nullsafe transpile (#6101)
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2021-04-15 19:16:27 +00:00
Tomas Votruba
b8071fb7bc
Make use of inline parser over extreme node construction (#6145)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-15 17:34:49 +00:00
Abdul Malik Ikhsan
a7234e7ac3
[Php73] Refactor JsonThrowOnErrorRector: change 2nd parameter of json_decode to null and skip on json_last_error, json_last_error_msg (#6143) 2021-04-15 17:56:21 +02:00
Abdul Malik Ikhsan
3d88aefe05
[Php73] Skip RegexDashEscapeRector on 3 backslash with next to be escaped (#6144) 2021-04-15 17:55:53 +02:00
TomasVotruba
e3e5b5869c fix return 2021-04-15 10:49:24 +02:00
Tomas Votruba
919849dc66
[Downgrade 72] Add DowngradeStreamIsattyRector (#6140) 2021-04-14 22:30:57 +00:00
Abdul Malik Ikhsan
bd2c7aee9f
[DowngradePhp70] Add DowngradeAnonymousClassRector (#6122)
* [DowngradePhp70] [WIP] Add DowngradeAnonymousClassRector

* typo

* add test

* check is anonymous

* adding new Anonymous class before class

* anonymous class must have New_ parent

* getting args

* without param

* with args fixture

* adding with args

* debug

* with args

* getting args from next attribute

* try move to New_

* skip not anonymous

* try using New_

* [ci-review] Rector Rectify

* it works with New_ node

* with addNodeBeforeNode()

* class exists fixture

* adding increment class if exists

* implemented increment class name for inside class

* handle no namespace

* in function

* in function no namespace

* works

* register to downgrade php70 set

* [ci-review] Rector Rectify

* typo fix

* phpstan

* [ci-review] Rector Rectify

* add handle in closure

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-14 19:55:20 +02:00
Tomas Votruba
219b45c096
[Downgrade 7.3] Add DowngradeArrayKeyFirstLastRector (#6137)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-14 16:08:07 +00:00
Tomas Votruba
8f256fa281
[DeadCode] Fix RemoveUnusedVariableAssignRector for variable removal (#6133) 2021-04-14 13:02:16 +00:00
Michal Lulco
22d35689bf
[League event] Dispatch only strings to anonymous class (#6120)
* [League event] Fix: dispatch only strings to anonymous class

* [League event] Dispatch only strings to anonymous class

* Fixed phpstan
2021-04-13 19:14:34 +02:00
Tomas Votruba
8b402bfe02
Make use of File object instead of passing around provider of file info, tokens, stmts etc. (#6110)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-13 00:12:48 +00:00
Tomas Votruba
5dcedbd825
Remove isOnClassMethodCall() (#6116) 2021-04-12 20:04:30 +00:00
Abdul Malik Ikhsan
620309c0d7
[CodeQuality] Avoid double negation on UnnecessaryTernaryExpressionRector (#6115)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-12 22:02:23 +02:00
Tomas Votruba
37d5978025
Standardize added file testing + remove doTestExtraFile() from AbstractRectorTestCase (#6113) 2021-04-12 19:00:57 +00:00
Abdul Malik Ikhsan
4d4fb3611f
[DowngradePhp70] Add DowngradeStrictTypeDeclarationRector (#6107)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-12 17:28:54 +02:00
Tomas Votruba
ad7af917e2
Improve assert added and moved nodes (#6106) 2021-04-12 13:24:37 +00:00
Tomas Votruba
06f85e4a68
Refactor file processors towards universal collector (#6085)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-12 10:34:04 +00:00