Commit Graph

140 Commits

Author SHA1 Message Date
Tomas Votruba 2ef7fcfcd2 Updated Rector to commit 23bad1ec21a1ba71c748073cae083ce55484e1a7
23bad1ec21 [EarlyReturn] Add ReturnEarlyIfVariableRector (#2609)
2022-07-02 22:36:41 +00:00
Tomas Votruba a0705ea3d6 Updated Rector to commit 6845975035
6845975035 [Core] Replace deprecated ->enterCatch() with enterCatchType() (#2548)
2022-06-25 16:12:40 +00:00
Tomas Votruba 582aecc7dd Updated Rector to commit 237f603c81
237f603c81 Skip all but exactly one return (#2565)
2022-06-25 16:12:31 +00:00
Tomas Votruba f8d669f3e6 Updated Rector to commit dcad222eb7
dcad222eb7 [Core] Handle Scope not available on DowngradeArrayIsListRector+DowngradePregUnmatchedAsNullConstantRector (#2556)
2022-06-25 16:11:22 +00:00
Tomas Votruba 138ae66a5b Updated Rector to commit 83f2b16f0c
83f2b16f0c [cs] add static lambda rule [closes #2514]
2022-06-21 15:38:46 +00:00
Tomas Votruba 7fbc26bbc7 Updated Rector to commit 797cb38b88
797cb38b88 Clean PHPStan errors (#2475)
2022-06-10 14:48:54 +00:00
Tomas Votruba bdec76e60e Updated Rector to commit 5ed173f14865e72ba7156645e2a79930152e1cc5
5ed173f148 skip RuleDefinition explicitly
2022-06-07 09:18:30 +00:00
Tomas Votruba bdfd24339f Updated Rector to commit 2e977bd3aad21113e0bb7e2aa9b102f6f1e9246d
2e977bd3aa deploy to original repository
2022-06-07 08:22:29 +00:00
Tomas Votruba aa2cb1b997 Updated Rector to commit 0eba231b07
0eba231b07 [PHP 8.1] Move ConstantListClassToEnumRector to PHP 8.1 (#2444)
2022-06-06 17:12:56 +00:00
Tomas Votruba a28f4b14a4 Updated Rector to commit 2022-06-06 16:43:29 +00:00
Tomas Votruba 7e46eb8267 Updated Rector to commit a2d6da8b4e
a2d6da8b4e Back to php-scoper 0.14 with scoping from php 8.0 (#2370)
2022-05-27 11:51:31 +00:00
Tomas Votruba beba7d6efe Updated Rector to commit 1249d947f4
1249d947f4 Try php-scoper 0.17 (#2368)
2022-05-27 11:25:02 +00:00
Tomas Votruba bca89e29da Updated Rector to commit 33cd52e703
33cd52e703 Fix position of class after non-reachable stmts (#2299)
2022-05-12 09:11:03 +00:00
Tomas Votruba 060b1642ed Updated Rector to commit 55be345ca9
55be345ca9 Various improvements (#2291)
2022-05-11 17:53:44 +00:00
Tomas Votruba aa0465d388 Updated Rector to commit 975fdf113f
975fdf113f [DX] Add StmtsAwareInterface to catch node by type (#2269)
2022-05-08 20:57:50 +00:00
Tomas Votruba 992aade98a Updated Rector to commit d89c23267c
d89c23267c [automated] Re-Generate Nodes/Rectors Documentation (#2262)
2022-05-08 00:33:36 +00:00
Tomas Votruba f63eef01d0 Updated Rector to commit 2dd8c6b814
2dd8c6b814 [CodeQuality][DeadCode] Add For_, Closure, and Finally_, Case_, Catch_ to NodeTypeGroup::STMTS_AWARE (#2258)
2022-05-07 18:33:57 +00:00
Tomas Votruba 2786be52f6 Updated Rector to commit c2ade0583c
c2ade0583c [DX] Refactor ChangeNestedIfsToEarlyReturnRector to direct return (#2250)
2022-05-07 09:28:12 +00:00
Tomas Votruba 6a2c9a5de2 Updated Rector to commit 176d6d7e2a
176d6d7e2a Refactor ChangeAndIfToEarlyReturnRector to work with stmts (#2244)
2022-05-06 22:31:31 +00:00
Tomas Votruba 9dacdb4abb Updated Rector to commit 464b74c40d
464b74c40d [Core] Merge BetterNodeFinder findFirstPreviousOfNode() with findFirstPrevious() (#2213)
2022-05-02 12:45:52 +00:00
Tomas Votruba 7a30fbb500 Updated Rector to commit c8b47df3e4
c8b47df3e4 [Core] Remove loop on FilesFinder::findInDirectoriesAndFiles() (#2201)
2022-04-30 06:41:39 +00:00
Tomas Votruba 5147929731 Updated Rector to commit 43aa4d91f7
43aa4d91f7 Add SameNamespacedTypeSpecifier (#2169)
2022-04-26 08:13:18 +00:00
Tomas Votruba 5c6eec2156 Updated Rector to commit 3596755157
3596755157 [EarlyReturn][Php80] Fix used along tweak between Php8ResourceReturnToObjectRector+ChangeOrIfReturnToEarlyReturnRector (#1984)
2022-04-01 05:37:14 +00:00
Tomas Votruba 7ede09fb94 Updated Rector to commit a375ee2641
a375ee2641 [Core][EarlyReturn][Php73] Fix used along tweak between JsonThrowOnErrorRector + ChangeAndIfToEarlyReturnRector (#1979)
2022-03-30 06:32:05 +00:00
Tomas Votruba c91768f1b2 Updated Rector to commit 9660188944
9660188944 [phpstan] Add known array keys types (#1909)
2022-03-07 11:51:39 +00:00
Tomas Votruba 4b2d0513ec Updated Rector to commit 33158773d1
33158773d1 [EarlyReturn] Clean up unnecessary tweak on ChangeOrIfReturnToEarlyReturnRector (#1843)
2022-02-20 14:15:59 +00:00
Tomas Votruba 4fecedf316 Updated Rector to commit 5fa9dd95a1
5fa9dd95a1 [EarlyReturn] Refactor RemoveAlwaysElseRector to return array of Nodes to avoid node in else marked as removed (#1840)
2022-02-20 10:50:37 +00:00
Tomas Votruba fd3e7425db Updated Rector to commit 4399f28ee1
4399f28ee1 [Core] Apply CREATED_BY_RULE attribute as array collection of applied Rector rule (#1600)
2021-12-31 10:33:05 +00:00
Tomas Votruba 143f4b8549 Updated Rector to commit b7da222d01
b7da222d01 [Php74] Skip protected property on final class with parent not loaded on TypedPropertyRector (#1560)
2021-12-24 20:47:54 +00:00
Tomas Votruba 3266f22182 Updated Rector to commit 1d409bc35b
1d409bc35b safe by default
2021-12-10 10:22:23 +00:00
Tomas Votruba 058d52567d Updated Rector to commit c621d7650d
c621d7650d [TypeDeclaration] Add void upper inner function has return on ReturnTypeDeclarationRector (#1447)
2021-12-10 09:57:54 +00:00
Tomas Votruba c726969380 Updated Rector to commit fc10fce13d
fc10fce13d [Rectify] [Php81] Enable Rectify on Readonly Property only (#1384)
2021-12-04 12:47:17 +00:00
Tomas Votruba b426e4ba33 Updated Rector to commit 6340d263f4
6340d263f4 [DX] Add strict PHPStan rules - step #3 (#1331)
2021-11-28 17:35:55 +00:00
Tomas Votruba eedc2efbf7 Updated Rector to commit cfae725119
cfae725119 Remove mixing workaround, not needed anymore (#1300)
2021-11-24 20:49:18 +00:00
Tomas Votruba 2d7c98b0a1 Updated Rector to commit bc5462b8ae
bc5462b8ae [DeadCode][EarlyReturn] Handle RemoveUnusedVariableAssignRector + RemoveAlwaysElseRector (#1277)
2021-11-20 13:38:45 +00:00
Tomas Votruba 7e333cd42a Updated Rector to commit 7143376acb
7143376acb [EarlyReturn][Php73] Handle JsonThrowOnErrorRector + ChangeAndIfToEarlyReturnRector (#1272)
2021-11-19 09:08:20 +00:00
Tomas Votruba ee85d297c4 Updated Rector to commit 8e6701c3c9
8e6701c3c9 Merge ParentFinder to BetterNodeFinder (#1168)
2021-11-06 14:57:23 +00:00
Tomas Votruba a94a50e863 Updated Rector to commit e525dad6ab
e525dad6ab [PHPStan 1.0] Use Nette filesystem over phpstan filewriter (#1115)
2021-10-30 14:18:31 +00:00
Tomas Votruba 0334d1bfd6 Updated Rector to commit 6bcdc92198
6bcdc92198 [Php80] Add Php8ResourceReturnToObjectRector (#1068)
2021-10-27 14:59:18 +00:00
Tomas Votruba 070eedc010 Updated Rector to commit fd5edffa38
fd5edffa38 [TypeDeclaration] Add TypedPropertyFromStrictGetterMethodReturnTypeRector (#1048)
2021-10-23 21:09:26 +00:00
Tomas Votruba e37558a911 Updated Rector to commit 600a3e9be1
600a3e9be1 [Core] Refactor AbstractRector (#959)
2021-10-18 19:19:09 +00:00
Tomas Votruba 93ca3f3280 Updated Rector to commit 0552b3a885
0552b3a885 [EarlyReturn] Handle continue/break in foreach with next return on ChangeAndIfToEarlyReturnRector (#946)
2021-10-01 18:08:07 +00:00
Tomas Votruba e6b6f5b661 Updated Rector to commit a2a378e016
a2a378e016 [EarlyReturn] Refactor ChangeAndIfToEarlyReturnRector: return array of Nodes (#885)
2021-09-15 12:50:35 +00:00
Tomas Votruba cdd58e83f2 Updated Rector to commit 6f0288df97
6f0288df97 [EarlyReturn] Refactor ChangeAndIfToEarlyReturnRector (#878)
2021-09-14 05:51:11 +00:00
Tomas Votruba ca094bb20d Updated Rector to commit fa63510c6f
fa63510c6f [PHPStan] PHPStan fixes after update symplify (#876)
2021-09-13 15:56:50 +00:00
Tomas Votruba b9f564d955 Updated Rector to commit 7bc977882e
7bc977882e [EarlyReturn] Returns array of nodes on ReturnBinaryOrToEarlyReturnRector + ReturnBinaryAndToEarlyReturnRector (#855)
2021-09-09 02:08:49 +00:00
Tomas Votruba 13a376a756 Updated Rector to commit c9f333d9dd
c9f333d9dd [EarlyReturn] Returns array of If_ on ChangeOrIfContinueToMultiContinueRector (#854)
2021-09-09 01:20:04 +00:00
Tomas Votruba 7a65a9b047 Updated Rector to commit 70e4b3c51f
70e4b3c51f [EarlyReturn] Do not move up variable up next foreach on ChangeAndIfToEarlyReturnRector (#852)
2021-09-08 17:22:06 +00:00
Tomas Votruba d5b6ae034e Updated Rector to commit 5b17710c25
5b17710c25 [EarlyReturn] Returns array of If_ on ChangeOrIfReturnToEarlyReturnRector (#853)
2021-09-08 17:20:44 +00:00
Tomas Votruba ec2e07443a Updated Rector to commit 49033cecc9
49033cecc9 [PostRector] Using NodesToAddCollector in Rector rules (#812)
2021-09-02 06:46:57 +00:00
Tomas Votruba 81454a9154 Updated Rector to commit 93f0232d7f
93f0232d7f Bump deps (#804)
2021-08-31 19:26:04 +00:00
Tomas Votruba 9c8dad9aed Updated Rector to commit 25d3555abd
25d3555abd [EarlyReturn] Clean up ChangeOrIfReturnToEarlyReturnRector skip check (#800)
2021-08-31 15:21:01 +00:00
Tomas Votruba 52dd92cc24 Updated Rector to commit 2e18cab758
2e18cab758 [EarlyReturn] Skip left or right is BooleanAnd on ChangeOrIfReturnToEarlyReturnRector (#799)
2021-08-31 15:10:56 +00:00
Tomas Votruba d807beef93 Updated Rector to commit c42b1969ce
c42b1969ce [EarlyReturn] Handle Next Node is null on ChangeOrIfReturnToEarlyReturnRector (#798)
2021-08-31 13:22:32 +00:00
Tomas Votruba d5b84771d3 Updated Rector to commit 4d60c23f7c
4d60c23f7c [EarlyReturn] Skip same return expr on ChangeOrIfReturnToEarlyReturnRector (#797)
2021-08-31 13:04:35 +00:00
Tomas Votruba 13cd556d23 Updated Rector to commit 654d4a2a2b
654d4a2a2b [EarlyReturn] Skip ChangeOrIfReturnToEarlyReturnRector on next node is null or return void (#796)
2021-08-31 12:32:29 +00:00
Tomas Votruba ba205b46bb Updated Rector to commit 68d410ef00
68d410ef00 Trigger notification (#741)
2021-08-23 00:20:32 +00:00
Tomas Votruba 674f76ced2 Updated Rector to commit 877cbb2de8
877cbb2de8 fix(scoper): prefix vendor classes from PHPDoc, close #6614 (#739)
2021-08-22 23:17:31 +00:00
Tomas Votruba aeb2451688 Updated Rector to commit c115811102
c115811102 [DeadCode] Skip Union Array without type on RemoveDeadInstanceOfRector (#672)
2021-08-13 20:43:09 +00:00
Tomas Votruba fd9090a133 Updated Rector to commit cc89395fee
cc89395fee [EarlyReturn] Handle Repetitive If_ on use ReturnBinaryOrToEarlyReturnRector (#670)
2021-08-13 20:42:45 +00:00
Tomas Votruba 40d9772df6 Updated Rector to commit de5c4c77a5
de5c4c77a5 [EarlyReturn] Allow usage ChangeOrIfReturnToEarlyReturnRector and RemoveAlwaysElseRector without elseif (#655)
2021-08-12 16:01:53 +00:00
Tomas Votruba 359cdb2450 Updated Rector to commit 8e48e49823
8e48e49823 [EarlyReturn] Skip complex if cond and with ChangeAndIfToEarlyReturnRector and RemoveAlwaysElseRector (#654)
2021-08-12 13:13:24 +00:00
Tomas Votruba 93cc8dacbc Updated Rector to commit 906bb39c8d
906bb39c8d [EarlyReturn] Handle Repetitive create If_ statement on use ChangeOrIfReturnToEarlyReturnRector+RemoveAlwaysElseRector (#651)
2021-08-12 09:54:28 +00:00
Tomas Votruba 19c1eefae1 Updated Rector to commit e35724edae
e35724edae [EarlyReturn] Move comment in If_ stmt for ChangeAndIfToEarlyReturnRector (#648)
2021-08-11 16:14:49 +00:00
Tomas Votruba eb3537a9a5 Updated Rector to commit 9f7a8d8c21
9f7a8d8c21 [EarlyReturn] Handle both ChangeAndIfToEarlyReturnRector and ChangeOrIfReturnToEarlyReturnRector (#617)
2021-08-08 17:11:36 +00:00
Tomas Votruba 816016aac7 Updated Rector to commit 294bea2d18
294bea2d18 [FileProcessor] Run untill the file is fixed completelly (#432)
2021-07-15 03:40:51 +00:00
Tomas Votruba 96112cb1f0 Updated Rector to commit 2da49992cc
2da49992cc [Downgrade] [PHP 7.2] Make DowngradeParameterTypeWideningRector always downgrade to phpdoc type (#390)
2021-07-05 22:50:18 +00:00
Tomas Votruba 121ea7f23d Updated Rector to commit 48784457eb
48784457eb Fix doctrine inflector bug downgrade (#388)
2021-07-05 15:06:41 +00:00
Tomas Votruba a79e6f56df Updated Rector to commit ff1ad31d6a
ff1ad31d6a [PHP 7.2] Refactor DowngradeParameterTypeWideningRector to class method (#380)
2021-07-05 07:47:59 +00:00
Tomas Votruba bb3e86de23 Updated Rector to commit 904a5a7a1c
904a5a7a1c Make use of ClassMethodReturnVendorLockResolver (#377)
2021-07-04 21:21:47 +00:00
Tomas Votruba 636eeecaf4 Updated Rector to commit dfd048342b
dfd048342b [PHP 8.0] Run union types for filled param type too (#331)
2021-06-29 14:24:45 +00:00
Tomas Votruba aabefcfa4c Updated Rector to commit d7013d080b
d7013d080b [EarlyReturn] Handle If inside closure for ChangeAndIfToEarlyReturnRector (#289)
2021-06-25 12:32:16 +00:00
Tomas Votruba c908c481f1 Updated Rector to commit 24187781db
24187781db [EarlyReturn] Handle mirror comments before elseif on RemoveAlwaysElseRector (#234)
2021-06-16 17:49:09 +00:00
Tomas Votruba 6fa9c12855 Updated Rector to commit 4f26e3643d
4f26e3643d [Scoped] Early downgrade src/functions (#185)
2021-06-09 02:43:00 +00:00
Tomas Votruba f04617a297 Updated Rector to commit d88e3a3efb
d88e3a3efb Fix copy-paste errors in rule docs (#143)
2021-06-02 22:56:35 +00:00
Tomas Votruba 7313b64374 Updated Rector to commit b90952fdeb
b90952fdeb Let Rector upgrade itself to PHP 8 🤖😇 (#123)
2021-05-29 22:10:59 +00:00
Tomas Votruba cdc3b7adef Updated Rector to commit f451b0b8e1
f451b0b8e1 [PHP 8.0] Bump to promoted properties (#4)
2021-05-10 23:39:21 +00:00
Tomas Votruba 7d36c3b0b9 Updated Rector to commit a80cf5292d
a80cf5292d revert to working scoper 0.14
2021-05-10 22:23:08 +00:00
Tomas Votruba 363a910cf7 Updated Rector to commit a7db1ad94d
a7db1ad94d use scoper 0.15
2021-05-10 22:10:16 +00:00
Tomas Votruba d56e7982d0 Updated Rector to commit dedd4b55fe
dedd4b55fe make node_helper.php safe for similar names
2021-05-09 20:15:43 +00:00
TomasVotruba 0800c7cdc3 fix cs 2021-05-06 20:51:25 +02:00
Tomas Votruba 38248d08f4
Return array of nodes directly from refactor() if possible (#6366)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-05-06 10:23:37 +02:00
Abdul Malik Ikhsan ba20c5ed74
[EarlyReturn] Skip ChangeAndIfToEarlyReturnRector on has assign in loop with indirect return after loop (#6365)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-05-06 02:26:20 +02:00
Tomas Votruba 809d617708
Refactor OptionalParametersAfterRequiredRector to remove dependency from NodeRepository (#6098) 2021-04-11 10:27:20 +00:00
Tomas Votruba 79621dbb99
Flip @see to @changelog links (#6092) 2021-04-10 18:47:17 +00: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 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 a781b3bd12
Remove dynamic type checks (#5939) 2021-03-21 19:41:17 +01:00
TomasVotruba 3746f24cf4 remove FUNCTION_NODE attribute 2021-03-18 00:00:16 +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