Commit Graph

2023 Commits

Author SHA1 Message Date
Tomas Votruba
745a7a9739
[CodingStyle] Add CallUserFuncToMethodCallRector (#6328) 2021-05-04 14:59:15 +00:00
Tomas Votruba
21bf53f2ec
[CodeQuality] Add FuncGetArgsToVariadicParamRector (#6318) 2021-05-03 21:27:20 +00:00
Tomas Votruba
2e6d188522
[CodingStyle] Add variadic method call unpack to CallUserFuncCallToVariadicRector (#6316) 2021-05-03 21:03:16 +02:00
Tomas Votruba
d689800fe7
fix variable type (#6314) 2021-05-03 20:03:01 +02:00
Abdul Malik Ikhsan
c183278243
[DowngradePhp71] Allow downgrade negative offset string on variable/PropertyFetch/StaticPropertyFetch (#6311)
* [DowngradePhp71] Allow downgrade negative offset string on variable

* allow property fetch and static property fetch as well

* method name
2021-05-03 15:39:40 +00:00
Abdul Malik Ikhsan
a3f2346fa8
[DowngradePhp71] Nullable return on closure call on DowngradeNullableTypeDeclarationRector (#6303)
* [DowngradePhp71] Nullable return on closure call on DowngradeNullableTypeDeclarationRector

* fix
2021-05-03 10:20:55 +00:00
Tomas Votruba
c83ac3683e
Decouple specific rules from NonPhpFileProcessor to NonPhpRectorInterface contract (#6285) 2021-05-02 11:50:34 +00:00
Tomas Votruba
2037d55d6b
[PHP 8.1] Add ReturnNeverTypeRector (#6283) 2021-05-02 10:46:55 +00:00
Abdul Malik Ikhsan
bbba5304ad
[DowngradePhp70] Add DowngradeSessionStartArrayOptionsRector (#6282) 2021-05-02 10:29:26 +02:00
Tomas Votruba
1e4dfbe738
Nested stdclass (#6280) 2021-05-01 15:58:05 +00:00
Tomas Votruba
37e07762c5
Exclude error string from class names (#6279) 2021-05-01 13:24:15 +00:00
Abdul Malik Ikhsan
139c73c5b5
[TypeDeclaration] Add missing break; in loop in SilentVoidResolver::isSwitchWithAlwaysReturn() (#6278) 2021-05-01 12:33:28 +00:00
Tomas Votruba
0203e0fda1
[TypeDeclaration] Add array type from returned method call types (#6277) 2021-05-01 12:16:35 +00:00
Tomas Votruba
f925b62d9b
Report add array doc nodes (#6274) 2021-05-01 10:59:25 +00:00
Abdul Malik Ikhsan
9e91a8d401
[DowngradePhp70] Add DowngradeDefineArrayConstantRector (#6270)
* [DowngradePhp70] [WIP] Add DowngradeDefineArrayConstantRector

* add fixture

* create const

* it works

* skip inside method or inside function

* register DowngradeDefineArrayConstantRector to downgrade-php70 config set

* skip not in expression

* phpstan

* final touch

* ensure expression expr is a define func call

* final touch

* [ci-review] Rector Rectify

* working prototype

* update to Expression

* config

* phpstan

* final touch

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
Co-authored-by: TomasVotruba <tomas.vot@gmail.com>
2021-05-01 09:43:20 +02:00
TomasVotruba
898fc72cb7 remove commented dependency 2021-04-30 10:40:44 +02:00
Abdul Malik Ikhsan
e6157560c1
[CodeQuality] Add NarrowUnionTypeDocRector (#6262)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-30 10:28:36 +02:00
Tomas Votruba
52c4888374
[Downgrade 7.2] Fix DowngradeStreamIsattyRector with return (#6266) 2021-04-29 13:58:00 +00:00
Tomas Votruba
60da89954e
[TypeDeclaratoin] Skip type if changed (#6261) 2021-04-28 21:12:26 +00:00
Tomas Votruba
ca4d1fb1aa
[TypeDeclaration] Traverse the param node that is changed in ParamTypeFromStrictTypedPropertyRector (#6260) 2021-04-28 20:33:20 +00:00
Tomas Votruba
e83b7f2538
[PHPStan] Resolve dependency juggling (#6258) 2021-04-28 09:33:25 +00:00
Abdul Malik Ikhsan
41d2e52ffd
[Php80] Skip ChangeSwitchToMatchRector on no assign when not return (#6257)
Co-authored-by: Ruud Kamphuis <ruudk@users.noreply.github.com>
2021-04-28 09:13:39 +02:00
Tomas Votruba
cf9d8c202d
Failing test: Node type is not updated after executing rector (#6255)
Co-authored-by: Michal Lulco <lulco@efabrica.sk>
2021-04-28 00:11:40 +00:00
Abdul Malik Ikhsan
94cf4314e6
Fix DowngradeSpaceshipRector sample code (#6252) 2021-04-26 21:52:21 +00:00
Abdul Malik Ikhsan
2eb5af1aad
[DowngradePhp70] Add DowngradeSpaceshipRector (#6243)
* [DowngradePhp70] Add DowngradeSpaceshipRector

* register to downgrade-php70 config set

* CS fix

* phpstan

* [ci-review] Rector Rectify

* property fetch

* more fixtures

* implemented, skip namespaced variable

* implemented, skip namespaced variable

* better approach

* use variable named left, right

* move to new variable battleShipCompare

* [ci-review] Rector Rectify

* final touch

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-26 13:52:50 +02:00
Tomas Votruba
baa26986f2
Remove AnnotatedPropertyInjectToConstructorInjectionRector by splitting to Nette and Symfony packages (#6250) 2021-04-26 10:39:42 +00:00
Tomas Votruba
91d58e0c7d
Decouple PropertyConstructorInjectionManipulator (#6248) 2021-04-26 09:46:21 +00:00
Tomas Votruba
909463b7e0
[DependencyInjection] Move JMSInject part from AnnotatedPropertyInjectToConstructorInjectionRector to rector-symfony (#6247) 2021-04-26 09:37:09 +00:00
Abdul Malik Ikhsan
70de3a01cc
[Php80] Handle UnionTypesRector on object and specific class/type in union type (#6237)
Co-authored-by: Ruud Kamphuis <ruudk@users.noreply.github.com>
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-26 11:08:56 +02:00
Tomas Votruba
5cda5de4ac
Decouple Rector PHPStan rules to own package (#6242) 2021-04-25 23:12:14 +00:00
Tomas Votruba
7b1680875c
Merge ComposerModifier to ComposerFileProcessor (#6241) 2021-04-25 20:31:14 +02:00
Tomas Votruba
414a656ab9
Fix AUTOLOAD_PATHS and BOOTSTRAP_FILES in tests (#6239) 2021-04-25 09:23:15 +00:00
Abdul Malik Ikhsan
0ac5412aa0
[Php80] Add default case when variable initialized on ChangeSwitchToMatchRector (#6230)
* Add failing test fixture for ChangeSwitchToMatchRector

# Failing Test for ChangeSwitchToMatchRector

Based on https://getrector.org/demo/f7f2ba48-3c19-4fdb-bc0a-e956e037eefd

It's important to add the default case to prevent this error when passing another code:
```
Fatal error: Uncaught UnhandledMatchError: Unhandled match value of type int
```

https://3v4l.org/E64Um

* Closes #6216

* phpstan

* phpstan

Co-authored-by: Ruud Kamphuis <ruudk@users.noreply.github.com>
2021-04-25 09:07:36 +02:00
Abdul Malik Ikhsan
774ac29000
[Php80] Skip RemoveUnusedVariableInCatchRector when variable used next catch (#6231)
* Add failing test fixture for RemoveUnusedVariableInCatchRector

# Failing Test for RemoveUnusedVariableInCatchRector

Based on https://getrector.org/demo/194e0c75-cb30-4f02-a0de-70d32fbe152c

* Closes #6213

Co-authored-by: Ruud Kamphuis <ruudk@users.noreply.github.com>
2021-04-25 09:06:07 +02:00
TomasVotruba
1022edb763 fix parent class 2021-04-24 09:44:03 +02:00
Tomas Votruba
9e869098ff
[Downgrade PHP 7.2] Fix 2+ param position (#6227) 2021-04-24 07:13:59 +00:00
Abdul Malik Ikhsan
c51c1da262
[DeadCode] Use dependency injection for ConditionSearcher in RemoveUnusedVariableAssignRector (#6226) 2021-04-24 00:59:36 +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
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
b76346d710 fix style 2021-04-23 00:19:22 +02:00
TomasVotruba
7192eb2a4b fix type 2021-04-23 00:08:34 +02:00
Tomas Votruba
159acc8512
remove notifyFileChange() (#6206) 2021-04-22 23:51:32 +02:00
Tomas Votruba
1d0ba2a439
Add AbstractTestCase (#6205) 2021-04-22 21:36:50 +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