Commit Graph

1181 Commits

Author SHA1 Message Date
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
Abdul Malik Ikhsan
a2bb65c272
[Preload] Fixes root path when rector installed as dependency (#6324)
* [Preload] Fixes root path when rector installed as dependency

* move to tests bootstrap

* check in prefixed only
2021-05-04 13:49:15 +02:00
Tomas Votruba
cd8be43951
Update text for FileProccessor to use Rector interface contract (#6289) 2021-05-02 15:59:16 +00:00
Tomas Votruba
c83ac3683e
Decouple specific rules from NonPhpFileProcessor to NonPhpRectorInterface contract (#6285) 2021-05-02 11:50:34 +00:00
Tomas Votruba
5cda5de4ac
Decouple Rector PHPStan rules to own package (#6242) 2021-04-25 23:12:14 +00: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
Tomas Votruba
1d0ba2a439
Add AbstractTestCase (#6205) 2021-04-22 21:36:50 +00:00
TomasVotruba
420a2a8148 typo 2021-04-15 23:40:47 +02:00
TomasVotruba
5f66258231 typo 2021-04-15 23:40:10 +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
8976681b20 remove StaticNodeInstanceOf 2021-04-15 22:45:10 +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
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
Tomas Votruba
8b62025ce0
Cleanup composer update run (#6094)
* cleanup compoesr update run

* rename provideConfigFile() to provideConfigFilePath()

* merge AbstractComposerRectorTestCase to AbstractRectorTestCase

* rename ComposerProcessorNonPhp to ComposerFileProcessor
2021-04-10 22:12:50 +02:00
Tomas Votruba
9be459dd76
Workaround invalid tag value node on add return array (#6068)
* Skip invalid return tag

* skip @var and @param invalid tags too

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-09 19:36:06 +02:00
Sebastian Schreiber
4296d35903
[FEATURE] Use generic processor interface for non php files (#6060) 2021-04-09 18:44:00 +02:00
Tomas Votruba
cb60705d78
Restore parent relations on new nodes (#6057) 2021-04-08 12:44:26 +00: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
4f27f39e70
Remove dynamic type checks #3 (#5942) 2021-03-21 23:07:40 +00:00
Tomas Votruba
163b37a30a
[Testing] Use single config-based testing to isolate scope unite testing for core + community packages (#5837) 2021-03-19 21:29:10 +01:00
Tomas Votruba
8304d70f67
[Symfony] Decouple to own package (#5900) 2021-03-18 22:03:54 +00:00
TomasVotruba
6ca687a213 remove duplicated findFirstAncestorInstanceOf method 2021-03-18 12:09:26 +01:00
Tomas Votruba
37eb07af6e
move stubs to composer-autoload (#5890)
* move stubs to composer-autoload

* remove duplicate classes

* apply Rector
2021-03-18 02:10:01 +01:00
Tomas Votruba
69e66cbf1f
Replace StaticRectorStrings with Stringy class, remove CamelCaseFunctionNamingToUnderscoreRector to avoid naming rules (#5882) 2021-03-17 19:59:18 +00:00
Tomas Votruba
da12199150
cleanup return docs (#5834) 2021-03-13 16:15:10 +01:00
Tomas Votruba
9beb1da3c0
Move fixture requirement from command line to a test case (#5832) 2021-03-13 15:07:31 +01:00
Tomas Votruba
157c39aefc
[DX] move src/tests rules from micro-packages to single PSR-4 structure (#5826) 2021-03-12 23:20:25 +01:00
Tomas Votruba
80c4fc8aab
[TypeDeclarationg] Add Tokens iterator to AddArrayReturnDocTypeRector and AddArrayParamDocTypeRector (#5796)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-08 14:52:36 +00: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
Abdul Malik Ikhsan
f3af24321a
[Bin] Handle possible PHPStan Stubs runtime locations (#5649) 2021-02-23 10:50:13 +00: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
ddfeae3391
drop --match-git-diff, not reliable for dependencies; use enable_cache instead (#5609)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-18 15:55:31 +00:00
Ruud Kamphuis
8d58a6dd87
Fix merging of multiple calls to configure in sets (#5523) 2021-02-16 09:00:06 +01:00
Tomas Votruba
30ec07b6ac
include stubs in tests (#5565) 2021-02-15 20:50:26 +00:00
Tomas Votruba
afdf5839e7
[testing] change provideConfigFileInfo() to provideConfigFilePath() (#5518) 2021-02-12 19:19:40 +01:00
Tomas Votruba
346bacfe19
[Tests] Split main test case and community test case (#5481)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-10 11:57:25 +00:00
Tomas Votruba
1757e83cdc
misc, remove RemoveProjectFileRector (#5463) 2021-02-08 18:26:00 +00:00
Tomas Votruba
e04d820bc5
[CodeQuality] Improve CompactToVariablesRector to cover previously defined array (#5424) 2021-02-05 12:40:28 +00:00
Tomas Votruba
b6b8ac0c4c
Less traits 3, drop duplicated issue tests (#5385) 2021-01-31 00:14:13 +00:00
Abdul Malik Ikhsan
31f357d6c0
[BetterPhpDocParser] Handle parseString() got ShouldNotHappenException (#5299)
* Fixes #5267

* cs fix

* use true for 3rd parameter is_a

* try use method_exists

* patch in BetterPhpDocParser

* clean

* clean

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* phpstan

* phpstan

* phpstan

* add test case

* better solution

* phpstan

* phpstan

* clean up

* clean up

* phpstan

* clean up

* final touch: use ObjectType check instead

* better approach

* ensure $phpDocInfo->getVarTagValueNode() instanceof VarTagValueNode as well

* clean up

* use of the VarTagValueNode

* use of the VarTagValueNode

* use of the VarTagValueNode

* [ci-review] Rector Rectify

* phpstan

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-24 17:46:06 +01:00
Tomas Votruba
66d0b61a9d
[Comments] Decouple new package (#5239)
* [Comments] Decopule new package

* fix RemoveNonExistingVarAnnotationRector

* decopule PropertyFetchFinder

* misc

* fix fixed printer

* fix import

* remove dead code

* fix comparing nodes with tokens instead of identical compare

* remove complexity

* decouple IndentCharacterDetector

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-19 19:11:10 +00:00
Tomas Votruba
ad9448018c
[PhpDocInfo Decouple] Use php doc info from factories, not from attribute (#5229)
* use single method to create docs

* use phpDocInfoFactory instead of getAttribte php doc info in Rectors

* move callig to phpDocInfoFactory

* misc
2021-01-18 21:45:13 +00: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
cf142b3f06
[Exclusion] Move SomeRector class to under Tests (#5202) 2021-01-16 11:53:54 +01: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
6c11a254aa
[SymfonyCodeQuality] Add ExtractAttributeRouteNameConstantsRector (#5140)
* [SymfonyCodeQuality] Add ExtractAttributeRouteNameConstantsRector

* optimizations
2021-01-11 20:12:10 +00:00
Tomas Votruba
2cf2ee3f41
fix exclusion annotation for non-class rector descripton + simplify (#5117)
* fix exclusion annotation for non-class rector descripton + simplify

* add HasOffsetTypemapper

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-09 00:20:28 +00:00
Abdul Malik Ikhsan
fe639838d5
[BetterStandardPrinter] Improve duplicate comment handling when duplicated in multi parts (#5107)
* [BetterStandardPrinter] Improve duplicate comment handling when duplicated in multi parts

* clean up

* different comment name fixture

* fix
2021-01-07 20:05:19 +01:00
Abdul Malik Ikhsan
3a2d32c7fa
[BetterStandardPrinter] Failing fixture to not duplicate comment (#5106)
* [BetterStandardPrinter] Failing fixture to not duplicate comment

* Closes #4191

* phpstan
2021-01-07 19:33:27 +01:00