1279 Commits

Author SHA1 Message Date
Tomas Votruba
29e3bc9372
[NetteToSymfony] Decouple to own package (#6360) 2021-05-05 21:15:26 +00:00
TomasVotruba
6e212162c8 [CodeQuality] Add CallUserFuncWithArrowFunctionToInlineRector 2021-05-04 20:39:28 +02:00
Tomas Votruba
745a7a9739
[CodingStyle] Add CallUserFuncToMethodCallRector (#6328) 2021-05-04 14:59:15 +00:00
Tomas Votruba
ac7a03f800
[php-parser] upgrade to 4.10.5 - add src/constants.php to mimic new PHP 8.1 tokens; update test with unicode (#6325)
* add src/constants.php to mimic new PHP 8.1 tokens; update test with unicode

* include preload in dev repository too

* include preload function
2021-05-04 14:21:34 +02:00
Tomas Votruba
21bf53f2ec
[CodeQuality] Add FuncGetArgsToVariadicParamRector (#6318) 2021-05-03 21:27:20 +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
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
Abdul Malik Ikhsan
5b386ab5fe
[CodeQuality] Register NarrowUnionTypeDocRector to code-quality config set (#6269) 2021-04-30 12:35:34 +02:00
Tomas Votruba
ca4d1fb1aa
[TypeDeclaration] Traverse the param node that is changed in ParamTypeFromStrictTypedPropertyRector (#6260) 2021-04-28 20:33:20 +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
3f3811ab21
add dump_node() helper functoin (#6229) 2021-04-24 14:22:36 +00:00
Tomas Votruba
a3ec81fe1f
Add setter/getter factory (#6219) 2021-04-23 18:14:51 +00:00
Abdul Malik Ikhsan
91377902b2
[DowngradePhp70] Add DowngradeNullCoalesceRector (#6208) 2021-04-23 09:21:57 +02: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
94df140c4d
[Downgrade] Report changed widening in another class (#6193)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-22 11:29:04 +00:00
Sebastian Schreiber
5cab6367fb
[TASK] Use rector-installer to load config of extensions (#6174) 2021-04-22 10:30:18 +02: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
TomasVotruba
ddcc9d39c0 add iterable to PHP 7.1 downgrade set 2021-04-21 22:49:14 +02: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
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
Tomas Votruba
919849dc66
[Downgrade 72] Add DowngradeStreamIsattyRector (#6140) 2021-04-14 22:30:57 +00:00
Tomas Votruba
1e1c6eebd9
[prefixed] No polyfill on prefixed version (#6139) 2021-04-14 20:23:49 +02: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
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
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
26a5b86892
[Privatization] Remove MakeUnusedClassesWithChildrenAbstractRector as risky and full context is needed (#6091) 2021-04-10 20:18:49 +02:00
Michal Lulco
4b71eaa53d
League event: change dispatch string events to objects (#6029) 2021-04-09 23:20:49 +02:00
TomasVotruba
021ffc7ada fix cs 2021-04-08 17:50:23 +02:00
TomasVotruba
272df8a1e3 fix rector-generator config file path installed by 3rd party 2021-04-08 17:50:11 +02:00
Abdul Malik Ikhsan
0a9c6a8400
[CodeQuality] Register SimplifyIfNullableReturnRector to code-quality config set (#6047)
* [CodeQuality] Register SimplifyIfNullableReturnRector to code-quality config set

* handle next expression

* handle next expression

* handle next expression

* naming

* phpstan

* fixture fix

* fix

* check next early

* mirror comment not @var

* phpstan

* phpstan

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* phpstan

* more fixture for mirror comment without @var

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-07 00:00:14 +02:00
Tomas Votruba
31566dc869
Traverse phpdoc with use of PhpDocNodeVisitor (#6045)
* make use of new simple-php-doc-parser

* add ParamPhpDocNodeVisitor

* remove uneeded contracts

* skip bool instanceof

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-06 19:33:09 +02:00
Tomas Votruba
74dc172b74
Misc node printing improvements (#6034)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-04 15:07:52 +00:00
Abdul Malik Ikhsan
6fe05c462c
[DowngradePhp72] Add DowngradePregUnmatchedAsNullConstantRector (#6021)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-04 13:40:55 +02:00
Tomas Votruba
b2412ad62a
Refactor doctrine/annotation from dynamic to own static-reflection parser (#5974)
* remove doctrine/annotations

* Refactor doctrine/annotation parser to static reflection with phpdoc-parser

* remove doctirne-annotation-parser-syncer

* remove annotation stubs

* use nodes

* almost there

* [ci-review] Rector Rectify

* skip temporary

* phpstan: remove fixed messages

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-04 11:01:11 +02:00
Tomas Votruba
27e9ad030a
Remove buggy rules that depend on false condition of all class and calls analysis, to improve static reflection (#5958)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-23 23:13:35 +01:00
Tomas Votruba
60b58421e3
Add bootstrap files option to allow including files (#5964) 2021-03-23 18:53:39 +00:00
Michal Lulco
2d469d3068
Added upgrade league/event to 3.0 (#5929) 2021-03-23 12:49:40 +01:00
Tomas Votruba
6ba046ef2b
add Doctrine configs (#5945) 2021-03-22 02:55:01 +01:00
Tomas Votruba
0964e8c3d7
[Doctrine] Decopule to own package (#5943)
* [Doctrine] Decopule to own package

* move Doctrine outside
2021-03-22 01:53:42 +01:00
Tomas Votruba
89a7afb5a4
Merge DeadDocBlock to DeadCode (#5936) 2021-03-21 12:57:56 +00:00
Tomas Votruba
b28b8742fc
use rector-nette with tags (#5924)
* use rector-nette with tags

* redirect Kdyby sets

* use local ParamAnalyzer
2021-03-20 22:16:54 +01:00
Tomas Votruba
cfa61bc2dd
remove PhpDocNodeTransformerInterface overly abstraction; merge AttributeAwarePhpDoc to BetterPhpDocParser (#5920)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-20 16:27:18 +01:00
Tomas Votruba
c9df17990b
[CakePHP] Decouple to own package (#5918) 2021-03-20 10:40:50 +01:00
Tomas Votruba
8b1d88926e
make use of TwigSetList (#5917) 2021-03-20 03:03:02 +01:00
TomasVotruba
4bc2316d31 use bundles if possible 2021-03-19 22:42:13 +01:00
TomasVotruba
056ec7e62a add dev configs 2021-03-19 22:34:04 +01:00