Commit Graph

1014 Commits

Author SHA1 Message Date
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
Tomas Votruba 29e3bc9372
[NetteToSymfony] Decouple to own package (#6360) 2021-05-05 21:15:26 +00:00
Tomas Votruba 6da2c9b527
[Restoration] Remove RestoreFullyQualifiedNameRector as it depends on dynamic reflection and all loaded classes (#6358) 2021-05-05 18:36:11 +00:00
Abdul Malik Ikhsan b472a4e5b4
rollback xdebug-handler (#6356) 2021-05-05 18:10:20 +00:00
TomasVotruba 289eca5d2c [compiler] simplify downgrade paths 2021-05-05 20:07:04 +02:00
TomasVotruba d979511111 composer: bump min rector deps 2021-05-05 19:15:11 +02:00
Abdul Malik Ikhsan ca05997086
Rollback symfony/console version (#6355) 2021-05-05 17:05:54 +00:00
Abdul Malik Ikhsan 19be811796
[Scoped] Re-remove composer.lock before require phpstan-src (#6354)
* [Scoped] Re-remove composer.lock before require phpstan-src

* allow symfony-console ^4.3
2021-05-05 16:10:38 +00:00
Abdul Malik Ikhsan dabc7869bd
[Scoper] Allow "composer/xdebug-handler": "^1.3.0 || ^2.0" (#6349)
* [Scoper] Allow "composer/xdebug-handler": "^1.3.0 || ^2.0"

* single |

* config
2021-05-05 14:43:10 +00:00
TomasVotruba 442b5b3d51 use php-parser 4.10.4 and stable phpstan with same version 2021-05-04 20:40:00 +02:00
Tomas Votruba f5bb6cd17e
composer: use phpstan with php-parser 4.10.5 (#6327)
* composer: use phpstan with php-parser 4.10.5

* bump to php-cs-fixer 3.0

* bump to xdebug handler 2.0
2021-05-04 16:30:35 +02:00
TomasVotruba 3696a7ac9a lock php-parser to patch to avoid future errors 2021-05-04 14:45:52 +02: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
Abdul Malik Ikhsan f9170bec35
[Scoped] Fixing void return scoped php 7.0 (2) (#6290)
* [Scoped] Fixing void return scoped php 7.0

* undo change composer.json
2021-05-02 16:16:48 +00:00
TomasVotruba 07a0d4edbe try prefixd 2021-04-29 11:00:02 +02:00
TomasVotruba 3901ae3d1f use older pretty-package version to fix prefixed version 2021-04-29 10:17:30 +02:00
TomasVotruba 940b7d1526 use self-version in composer 2021-04-29 10:01:35 +02:00
Tomas Votruba e83b7f2538
[PHPStan] Resolve dependency juggling (#6258) 2021-04-28 09:33:25 +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 ba2d96c583
[composer] remove uuid package (#6228) 2021-04-24 16:04:10 +02:00
TomasVotruba ee9ed46d43 composer: bump rector split package 2021-04-24 14:32:02 +02:00
Tomas Votruba 1d0ba2a439
Add AbstractTestCase (#6205) 2021-04-22 21:36:50 +00:00
Sebastian Schreiber 5cab6367fb
[TASK] Use rector-installer to load config of extensions (#6174) 2021-04-22 10:30:18 +02:00
Ruud Kamphuis c87f5d7217
Allow `composer/xdebug-handler` v2 (#6179)
Hopefully this fixes:

```
  Problem 1
    - friendsofphp/php-cs-fixer is locked to version v3.0.0-rc.1 and an update of this package was not requested.
    - rector/rector 0.10.6 requires composer/xdebug-handler ^1.4 -> satisfiable by composer/xdebug-handler[1.4.0, ..., 1.4.6].
    - You can only install one version of a package, so only one of these can be installed: composer/xdebug-handler[1.4.0, ..., 1.4.6, 2.0.0].
    - friendsofphp/php-cs-fixer v3.0.0-rc.1 requires composer/xdebug-handler ^2.0 -> satisfiable by composer/xdebug-handler[2.0.0].
    - Root composer.json requires rector/rector ^0.10.6 -> satisfiable by rector/rector[0.10.6].
```
2021-04-20 19:09:06 +02:00
Tomas Votruba 101041d6ae
[DeadCode] Remove RemoveDefaultArgumentValueRector (#6148) 2021-04-16 00:11:58 +02:00
Tomas Votruba a07e49c43b
bump Symplify packages (#6134) 2021-04-14 14:29:15 +00: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
TomasVotruba 3e4e9387c6 bump package rector deps 2021-04-09 18:27:12 +02:00
TomasVotruba fae4a7512e composer: bump retcor phpunit 2021-04-09 17:15:27 +02:00
Tomas Votruba e85dbf0422
[PHP 7.0] Cover named ctor with for (#6064) 2021-04-09 15:07:21 +00:00
Tomas Votruba 6ced3bd32a
Add upgrade path to Rector 0.10 - upgrade set included (#6061)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-04-09 01:12:42 +00:00
Tomas Votruba 8624cec9e5
use Symplify stable (#6054) 2021-04-08 12:23:34 +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 047045636f
comoser: bump package deps with static doctrine/annotation parser (#6040) 2021-04-05 14:22:24 +00: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 5fa858b072
[DoctrineAnnotationSyncer] Remove to move to static reflection (#6006) 2021-03-29 13:01:35 +00:00
TomasVotruba c13d234e7d bump deps 2021-03-23 21:59:28 +01:00
TomasVotruba 2df54ae634 use self alias for deps 2021-03-23 21:51:49 +01:00
TomasVotruba 63dadb0888 composer: bump alias to 11-dev 2021-03-23 21:42:47 +01:00
TomasVotruba 29215c4d86 composer: bump to phpdoc-parser 0.5.2 2021-03-23 21:33:50 +01:00
TomasVotruba 3b81a2ac1a composer: lock to doctrine package 2021-03-22 03:00:15 +01:00
Tomas Votruba 6ba046ef2b
add Doctrine configs (#5945) 2021-03-22 02:55:01 +01:00
TomasVotruba e7117092bf update to doctrine package 2021-03-22 02:31:22 +01:00
TomasVotruba 2526139e4d use DoctrineSetList 2021-03-22 02:03:56 +01:00
TomasVotruba 56b5ac0610 composer: require 0.10 dector deps 2021-03-22 00:23:46 +01:00
Tomas Votruba 44375f6637
Post Nette tags split cleanup (#5925)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-20 21:47:40 +00:00
TomasVotruba 944c5e6bc1 dev-main 2021-03-20 20:35:19 +01:00
TomasVotruba 6f8d61a6bc composer: add branch alias 2021-03-20 20:32:54 +01:00
TomasVotruba 49c81bec47 composer: remove replace-self 2021-03-20 19:28:36 +01:00
Tomas Votruba c9df17990b
[CakePHP] Decouple to own package (#5918) 2021-03-20 10:40:50 +01: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 025e6ed571
[PhpDocParser] Make use of native attributes (#5841)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-19 14:33:58 +00:00
TomasVotruba abed1ff280 composer: allow phpstan 0.12.82 2021-03-19 11:30:21 +01:00
Tomas Votruba 16b2b0376c
[PHPUnit] Decouple to own package (#5905) 2021-03-19 10:52:08 +01:00
Tomas Votruba 3aa1f86778
[Laravel] Decouple to own package (#5904) 2021-03-19 02:09:51 +01:00
Tomas Votruba 21db1e9e38
[Nette] Decouple to own package (#5903)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-19 01:33:30 +01:00
TomasVotruba 9d5e99cf74 bump deps 2021-03-19 00:36:11 +01:00
TomasVotruba 69471cb59e use stable version 2021-03-18 23:52:44 +01:00
Tomas Votruba 8304d70f67
[Symfony] Decouple to own package (#5900) 2021-03-18 22:03:54 +00:00
TomasVotruba e61f80bd21 cleanup 2021-03-18 12:21:20 +01:00
TomasVotruba 6ca687a213 remove duplicated findFirstAncestorInstanceOf method 2021-03-18 12:09:26 +01:00
Tomas Votruba 6af2805a1c
Move symfony/cache to simpler nette/caching (#5889)
* composer: remove symfony/cache

* [Caching] Add nette/cache, lighter

* make sure cache directory exists
2021-03-18 02:11:54 +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 683f8319a8
[CI] simplify php linter (#5867)
* [CI] simplify php linter

* [CI] merge code analysis to one

* [docs] remove nodes overview, already in external repository

* remove unused ci job

* [CI] check annotation parser + sync

* [DeadCode] Remove RemoveEmptyAbstractClassRector, not reliable with static-reflection, opionated

* [CI] remove set validation, PHPStan handles this better with PHP

* remove dead-code-strict [skip ci]
2021-03-15 23:44:28 +01:00
Tomas Votruba c1c6c9aaf2
[downgrade] remove extra configs, unite parameters (#5861) 2021-03-15 13:19:57 +00:00
TomasVotruba 09f7d76368 fix namespace autoload 2021-03-14 14:22:25 +01:00
Tomas Votruba 751a7453dd
Apply new PHPStan rules from Symplify (#5843)
* apply new PHPStan rules from Symplify

* less directories to speedup CI
2021-03-14 14:11:24 +01:00
TomasVotruba e59694cda1 composer: disable platform check to allow downgraded and prefixed rector 2021-03-13 20:50:37 +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 0acc05cc6e
remove runnable interface, to lower complexity (#5829) 2021-03-13 01:23:22 +00:00
Tomas Votruba 721f619a1d
Post moving cleanup (#5827) 2021-03-12 23:52:38 +00: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 c791f5ed60
[RectorGenerator] Decouple to external package (#5825) 2021-03-12 20:13:27 +01:00
Tomas Votruba 67670e70ad
[DX] move packages from src/tests to single PSR-4 directory (#5824) 2021-03-12 01:21:29 +00:00
Tomas Votruba 79d3d98e14
fix ctor (#5808) 2021-03-09 00:04:39 +00:00
Tomas Votruba 1cbb6113fc
[CI] remove changelog linker (#5803) 2021-03-08 19:50:03 +00:00
Tomas Votruba 896ca733dc
cherry-pick downgrade update (#5794) 2021-03-07 21:25:43 +00:00
Tomas Votruba ba1444959d
[TypeDeclaration] Improve param by caller type #2 (#5787) 2021-03-07 14:27:17 +00:00
Tomas Votruba 031deda881
[TypeDeclaration] Add AddParamTypeFromCallersRector (#5782) 2021-03-06 21:16:18 +00:00
Tomas Votruba c1dab30664
[MockistaToMockery] Drop as mockista is completely dead package (#5758) 2021-03-03 18:40:45 +01: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
Tomas Votruba d5bf66f9cd
[CI] run rules dir by dir to identify static reflection weak sposts (#5720)
* [CI] run rules dir by dir to identify static reflection weak sposts

* [ci-review] Rector Rectify

* consistency

* remove unused property

* add data provider test fixture

* add InvertedIfFactory to lower complexity

* [DeadCode] Skip unused public method if data provider

* misc

* [DeadCode] Do not remove class method if required by parent ocntract

* make use of ContextAnalyzer to find the loop

* narrow dirs one level

* narrow packages

* narrow

* use directly

* narrow

* correct constant name to keep BC

* bump deps

* add version_compare to removed extra params, just to be sure

* do not return function node on unchanged name

* narrow

* add support for multiple variants

* widen

* remove double check [skip ci]

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-02 14:43:36 +01:00
Tomas Votruba 11dab764e6
[PHPStanStaticTypeMapperChecker] Drop as very limited testing benefit, overly protective (#5721) 2021-03-02 11:22:49 +00:00
Tomas Votruba 05788745fd
[Downgrade] Remove excessive abstract class inheritance, use single service (#5717) 2021-03-01 12:10:50 +00:00
Tomas Votruba 47743269e8
Removing parent classes (#5714) 2021-03-01 02:28:35 +01:00
Tomas Votruba 4909e63a1d
Make use of static reflection from PHPStan (#5665)
* break test without autoload

* PHPStanServiceFactory - add tests directory as analysed paths

* use ReflectionProvider instead of class_exists

* use native reflections for annotation reader

* use native class and method reflections

* add RectorBetterReflectionSourceLocatorFactory

* add DynamicSourceLocator that is shared by PHPStan and Rector

* use ReflectoinProvider instead of class_exists()

* resolve native ClassMethodReflection

* make AnonymousFunctionFactory use reflection

* [DowngradePHP74] Improve DowngradeCovariantReturnTypeRector

* phsptan: avoid ClassReflection

* ProcessCommand: add file infos to source locator

* [DeadCode] Skip RemoveUnusedPublicMethodRector for test

* remove autolaod from tests

* misc

* remove is_a()

* [CI] enable only few dirs to avoid fails

* misc

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-28 08:47:48 +01:00
Abdul Malik Ikhsan c480e0468c
[Meta] Add Monorepo Builder (#5669) 2021-02-27 12:37:07 +01:00
Tomas Votruba ecf4e56246
update monorepo-builder syntax (#5662) 2021-02-23 12:15:16 +01:00
Tomas Votruba 5ba33240ca
Bump to Symplify 9.2.1 (#5655) 2021-02-22 20:05:33 +00:00
Tomas Votruba 9a376d98e5
[Arguments] New rule set from former generics (#5637)
* [Transform] Move SingleToManyMethodRector

* [Transform] Move WrapReturnRector here

* [DependencyInjectoin] Move AddMethodParentCallRecto here

* [Arguments] Create new package from old generics only around arguments

* composer docs uild
2021-02-21 00:21:19 +01:00
Tomas Votruba 651573a58f
[TypeDeclaration] Add ReturnTypeFromStrictTypedCallRector (#5573) 2021-02-16 16:12:37 +00:00
Tomas Votruba 30ec07b6ac
include stubs in tests (#5565) 2021-02-15 20:50:26 +00:00
TomasVotruba 5976af5b01 lock to last working phpstan 2021-02-15 20:42:36 +01:00
Tomas Votruba 1d80ef3df6
[TypeDeclaration] Add external types to ParamTypeFromStrictTypedPropertyRector (#5560) 2021-02-15 19:31:53 +00:00
Tomas Votruba de8fa30257
[cs] apply indent of call in configs (#5547) 2021-02-14 21:28:21 +00:00
Tomas Votruba 6ce792c70a
[CodingStyle] Drop AnnotateThrowablesRector to narrow code scope, designed for custom community rule (#5528) 2021-02-13 15:19:19 +01:00
TomasVotruba 8bc126f1a7 lower phpdoc-parser to open slevomat 2021-02-13 02:13:52 +01:00
Tomas Votruba 7a3f5a8c0a
remove unused RectorClassesProvider (#5482)
* remove unused RectorClassesProvider

* README: remove ci-checkstyle link, marginal topic, to avoid confusion for first readers
2021-02-09 22:43:04 +00:00
Tomas Votruba 1757e83cdc
misc, remove RemoveProjectFileRector (#5463) 2021-02-08 18:26:00 +00:00
Tomas Votruba d7353baf2c
Misc cleanup (#5456)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-08 12:33:17 +00:00
Tomas Votruba e9cdf37d16
Decopule nodes docs generator (#5453)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-08 02:04:48 +01:00
Tomas Votruba 0c830ab123
misc (#5439) 2021-02-06 22:20:57 +00:00
Abdul Malik Ikhsan ac3611698b
[EasyCI] Using symplify/easy-ci for validate-file-length (#5431) 2021-02-06 12:34:59 +01:00
Michal Lulco 17cb30f5c7
Removed duplicit package sebastian/diff from composer.json (#5399) 2021-02-01 18:05:25 +01:00
Tomas Votruba 9a8cce6545
remove deprecated console differ, to use symplify (#5402)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-01 11:22:22 +01:00
Tomas Votruba b6b8ac0c4c
Less traits 3, drop duplicated issue tests (#5385) 2021-01-31 00:14:13 +00:00
Tomas Votruba 7293c3c2a8
less traits 2 (#5384) 2021-01-30 23:20:05 +00:00
Tomas Votruba 737b6471c2
[Performance] [Polyfill] Move to DeadCode (#5380) 2021-01-30 19:56:32 +00:00
Tomas Votruba 2df4732c6c
Move Architecture to Doctrine, improve a bit (#5374) 2021-01-30 08:57:35 +00:00
Tomas Votruba a4a490d69a
[Generics] Skip existing tag and add nullable type support (#5367) 2021-01-29 20:23:01 +00:00
Tomas Votruba 4590b10b43
[Process] Add --no-diffs for better huge CI debug (#5368) 2021-01-29 20:12:09 +00:00
TomasVotruba 6e4259b44f fix downgrade build 2021-01-29 20:48:08 +01:00
TomasVotruba ce1439826c allow phpstan new, now with fixed in symplify 2021-01-29 20:06:27 +01:00
Tomas Votruba 024ec4ba93
[Generics] Add GenericsPHPStormMethodAnnotationRector (#5365)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-29 17:24:20 +01:00
Alessandro Lai 033b2a38e9
Allow PrettyVersion 2 (#5364) 2021-01-29 17:14:06 +01:00
Tomas Votruba 53102c9c29
[Removing] Init new set (#5360)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-29 08:08:55 +00:00
Tomas Votruba 34c0f08969
[Generic] Split rules to their particular categories (#5354)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-29 00:32:20 +01:00
Tomas Votruba e0db712dec
[Symfony 5.2] Add LogoutHandlerToLogoutEventSubscriberRector (#5337) 2021-01-28 14:36:46 +00:00
Abdul Malik Ikhsan a54819aba8
[Symfony 5.2] Add FormBuilderSetDataMapperRector (#5339)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-28 13:57:27 +01:00
Tomas Votruba 485dce60bc
cleanup (#5322) 2021-01-26 09:50:32 +00:00
Tomas Votruba abadc5473b
[CI] add demo for build php 7.1 version (#4447)
* Renamed option to --exclude-path

* Exclude /**/tests/ by default

* Inverted order of downgrade

* Fixed verb

* Use sed to replace string

* Simplified message

* Use PHP version with "."

* Completed PHP versions to downgrade

* Execute Rector with --target-php-version

* Added quotes to array keys

* Allow to print command to output

* Execute script within workflow

* If rector fails, already exit 1

* Ignore PHP constraint

* Removed --dry-run and errors for testing

* Don't print command

* Run downgraded for ALL sets

* Include downgrade sets for testing

* Run all sets in a command each

* Added the target PHP version in each downgrade set

* Use a rector config file to pass exclude paths

* Exclude everything under /tests/

* Removed --dry-run

* Set unneeded transformations in false

* Exclude /ci/

* Exclude /compiler/

* Exclude DoctrineProvider

* Exclude classes for dependency-injection

* Exclude classes for http-kernel

* Exclude classes for symfony string

* Use cut instead of aws
For if the path has a space

* Calculate package execution order

* Downgrade packages on required order

* Consider the set to check package dependents

* Store packages_to_downgrade_by_set

* Store package_dependents["$package|$set"]

* Fixed converting from string to array

* Fixed converting string to array

* Fixed char

* Simplified counter

* Fixed string to array

* Fixed var

* Fixed getting dependents

* Fixed checking if dependent packages downgraded

* rector/rector has no dependents

* Simplified downgraded_packages

* Ignore dependent package on itself

* If circular dependencies, make the process fail

* Uncommented executing rector

* Exclude /stubs

* Calculate circular reference packages

* Break circular references

* Uncommented rector call

* Do downgrade ContainerBuilder

* Added expression-language as dep for PROD

* [ci-review] Generate Rector & Nodes documentation

* [ci-review] Apply coding standards

* [ci-review] Rector Rectify

* Obtain "rector/rector" from composer

* Removed commented code

* Don't do platform check for Composer v2

* Moved comment up

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* Must dump autload to remove platform_check.php

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* Copied file from master

* Use new convention (70000) for PHP versions (7.0)

* Fixed cs

* Fixed PHPStan

* Added "create-config" command - Initial commit

* [ci-review] Rector Rectify

* Moved rector config under custom folder

* Use predefined rector configs instead of injecting --set

* Created rector config files

* Use array of rector configs, even if only 1 is used

* Require once config file

* Fixed exclude paths

* Execute only last rector config (containing many sets)

* Exclude file that makes process fail

* Removed --dry-run

* Use existing option name

* Handle GROUP_RECTOR_CONFIGS in circular packages

* Changing PHP_VERSION_ID does not work, so commented rule

* Bug fixed => uncommented using rector

* Renamed NoParticularNodeRule to ForbiddenNodeRule

* [ci-review] Rector Rectify

* Fixed PHP version constants

* Added (failing) test

* Fixed issue for nullable scalars

* Can't run Rector with --set through CLI, removed

* Added (failing) test

* Fixed issue for __construct

* Fixed constant name

* Added (failing) test for self

* Added another (failing) test

* Fixed not adding "\" before "static", "self", etc

* [ci-review] Rector Rectify

* Skip downgrading CouchbaseBucketAdapter

* Renamed var

* Added (failing) test

* Fixed interface and abstract class issue

* [ci-review] Rector Rectify

* Fixed PHPStan error

* Create artifact of downgraded code

* Added missing spaces for args

* Use 4 spaces for consistency

* Ignore build folder in rector-php71.zip

* Switch to setup-php@v2

* Added (failing) test

* Issue is on calling method, not on constructor

* Implemented fix

* Renamed test

* Added further tests

* [ci-review] Rector Rectify

* Fixed PHPStan

* Fixed PHPStan

* Added (failing) test

* Fixed issue on new Class('foo', )

* Execute tests

* No need for quotes

* Made the artifact contain the folder, not a .zip

* Removed /compiler folder (it's been deleted?)

* Do upload the artifact as a .zip (too slow otherwise)

* Remove all tests, also from under vendor/

* Upgraded zip action version

* Change Composer's PHP requirement to 7.1

* Try exclude tests under vendor/

* Renamed artifact

* Try exclude tests under vendor/

* Updated test (to fail)

* If the float has no ".", add ".0" at the end

* Must remove deps before "composer require php"

* Replaced call to phpstan

* Cannot run PHPStan on 7.1, just run Rector

* Change Composer's PHP requirement to 7.1

* Remove DEV dependencies

* Require Symfony Polyfill libraries

* Rector without DEV needs phpstan.neon removed

* Run PHPStan

* Added paths to analyze

* Access PHPStan config from file

* Fixed relative paths

* Override the artifact with downgraded Composer too

* Uncommented scanDirectories

* Include tests/ in artifact

* Exclude */tests/*

* Ignore utils/phpstan-extensions

* PHPUnit is installed in DEV, can't use it in PROD

* "nette/application" is on DEV, may not exist on PROD

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* Improved comment after rectify

* Fixed previous messed-up merge

* Removed 1st slash

* Downgrade all dependencies together

* Replace the composer.json file

* Can't have more than 1 path to downgrade

* No need to change PHP requirement to 7.1 anymore

* Remove DEV dependencies before replacing composer.json

* Changed order of commands

* No need for --ignore-platform-req=php

* Add all Symfony polyfill libraries

* Require Symfony polyfill libraries earlier on

* Test removing `ignoreErrors` from PHPStan

* Remove ignored errors which do not apply

* Fixed the list of `excludes_analyse`

* Removed commented code

* Fixed PHPStan config

* Only analyze the target PHP version if GROUP_RECTOR_CONFIGS

* Simplified script: just analyze target PHP version

* Renamed downgrade sets

* Removed unneeded create-config command

* Removed call to deleted class

* Dropped ChangePhpVersionInPlatformCheckRector

* Must remove phpstan-for-rector.neon from PROD

* Do not execute --dry-run, it returns error

* Publish downgraded code to remote repository

* Removed commented code

* Standardized script code

* Initialize variables in script

* No need to initialize vars

* Remove the zip, do not copy to target repo

* Remove .git before deploying to target repo

* Copy files to rector-downgrade/

* Use branch "main"

* Copy also hidden files

* Remove docker publish image workflow

* Trigger own tests workflow

* Include "lowest"

* Run PHPStan instead of PHPUnit

* Run PHPStan in new temp directory

* Execute in same item

* "../" for --config doesn't work for PHPStan

* Added bare run test

* Added tests for PHP 7.2

* Added test

* Run with php

* Replaced namespace

* Added PHPUnit test for PHP 7.1

* Use PHP 7.1-compatible version of "doctrine/orm"

* Can't skip downgrading doctrine-annotation-generated

* Removed commented items

* Renamed test workflow

* Added comments on code

* Run all tests, not just 1

* Downgrade package from v3.1 to v3.0.7

* Run existing tests

* Revert tests

* [ci-review] Rector Rectify

Co-authored-by: Leonardo Losoviz <leo@getpop.org>
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-25 20:25:21 +01:00
Tomas Votruba 402a212737
[Phalcon] Drop custom rules, the framework does not have enough traction (#5313) 2021-01-25 17:34:49 +00:00
Tomas Votruba a0f7656b68
[RemoveAnnotationRector] Add node type support, merge JMS removal rules (#5310) 2021-01-25 16:20:05 +00:00
Michal Lulco c6ab3bf015
Added missing symfony/process to composer.json (#5264) 2021-01-20 15:12:17 +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 1cd0e1004f
add missing astral package (#5182) 2021-01-14 12:03:13 +00: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
Michal Lulco 4bd4a4657b
Full upgrade of codebase including changes in composer.json (#5074)
* Composer changer

* Implemented ChangePackage, ChangePackageVersion and RemovePackage with tests

* Refactored composer processor

* Refaktoring

* Added missing tests

* Added void return type to test

* Changed namespaces and fixed CI tests

* Apply rector rules

* Moved new line to processor from modifier

* Use array copies in tests

* Added descriptions to all construct parameters and inheritDoc to modify methods

* Rewritten ComposerModifierTest to use AbstractKernelTestCase and ComposerModifier as service

* Split MovePackage to 2 classes

* Sort packages if it is set in config

* Rectified

* Rename class ChangePackage to ReplacePackage

* Split class AddPackage to AddPackageToRequire and AddPackageToRequireDev

* Added Version checker and moved modifier classes to separated folder

* Changed array to ComposerJson in modify methods

* Rectifying

* Removed unnecessary docs

* Temporary added fork of composer-json-manipulator

* Removed unused code and replaced InvalidArgumentException to assert
2021-01-12 22:50:42 +01:00
Tomas Votruba d1df8f76cd
drop PHPStanAttributeTypeSyncer, handled by external package (#5131) 2021-01-10 14:51:27 +01:00
TomasVotruba 1aa0cb4550 bump deps 2021-01-10 02:28:32 +01:00
Tomas Votruba d478992160
Fix deprecated ref() to service() function, skip empty file (#5112)
* composer: bump to symfony/dependency-injection 5.1, required as minimum by other deps anyway

* use service() over deprecated ref()

* skip empty files

* skip just created props
2021-01-08 14:04:35 +00:00
Abdul Malik Ikhsan e1c89d17f6
[fixtures] Enable validate-fixture-skip-naming check (#5081)
* [fixtures] Enable validate-fixture-skip-naming check

* full path vendor vendor/symplify/easy-testing/bin/easy-testing validate-fixture-skip-naming rules tests

* 21 files

* more fixture

* various fix

* various fix

* more fixtures

* apply to packages rules tests utils

* more fixtures

* more fixtures

* more fixtures

* more fixtures

* more fixtures

* more fixtures

* more fixtures

* fixture fix

* done

* fixture fix
2021-01-04 14:18:27 +01:00
Tomas Votruba 014c019449
[fixtures] require skip prefix on skipped files (#5079)
* skip unnecesary test case

* namespace corrections, skip prefix corrections

* hide for now

* skip new phpstan cases
2021-01-03 15:54:27 +00:00
Grzegorz Korba a43d3e3863
Lower requirement for `phpstan/phpdoc-parser` (#5039) 2020-12-29 16:09:15 +01:00
Tomas Votruba 630c3d324e
[PhpVersionResolver] Add project composer.json as source + decouple to composer json fatcory (#5031)
* [PhpVersionResolver] Add project composer.json as source + decouple to composer json fatcory

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-29 00:32:48 +00:00
Tomas Votruba 52e604c6dd
[scoper] unprefix string classes to match types (#5025) 2020-12-28 23:09:11 +01:00
Tomas Votruba d4883d44d9
[Prefixed Rector] Add package-scoper approach (#4559) 2020-12-26 00:17:31 +01:00
Tomas Votruba ed475a2e3c
[static] no nullable node (#4995)
* move phpstan.neon cusotm rules to rector-rules.neon, to cleanup main config

* enable forbidden rule on nullable nodes

* bump to Symplify 9.0.17

* make name non-nullable

* skip non-nullable

* skip null dim
2020-12-25 20:50:50 +00:00
Tomas Votruba d256bbd8c0
change rector-ci.php to rector.php (#4994) 2020-12-25 19:11:33 +01:00
Tomas Votruba 51dd6b899a
[SOLID] Drop UseInterfaceOverImplementationInConstructorRector, very subjective (#4993) 2020-12-25 17:24:53 +00:00
Tomas Votruba a4f8a23ecf
[CodeQuality] Move MoveVariableDeclarationNearReferenceRector (#4992) 2020-12-25 17:48:15 +01:00
Tomas Votruba db89b5eefa
[CodeQuality] Move MoveVariableDeclarationNearReferenceRector (#4989)
* [CodeQuality] Move MoveVariableDeclarationNearReferenceRector

* move code-quality-strict rules to own namespace

* move MoveVariableDeclarationNearReferenceRector to CodeQualityStrict

* add ClassConstFetchFactory

* static fixes
2020-12-25 16:22:19 +00:00
Tomas Votruba a2dbaedb0e
[Privatization] Move MakeUnusedClassesWithChildrenAbstractRector here (#4987) 2020-12-25 15:45:17 +01:00
Tomas Votruba cffd7ea0ac
[CodingStyle] Move PHPStormVarAnnotationRector (#4985)
* [CodingStyle] Move PHPStormVarAnnotationRector

* [ci-review] Rector Rectify

* [DeadDocBlock] Move RemoveNonExistingVarAnnotationRector here (#4984)

* [DeadDocBlock] Move RemoveNonExistingVarAnnotationRector here

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>

* [ci-review] Rector Rectify

* cleanup docs

* static fixes

* [ci-review] Rector Rectify

* remove duplicated

* multi use case

* misc

* [ci-review] Rector Rectify

* fixes

* remove order set, slow

* move UseMessageVariableForSprintfInSymfonyStyleRector from solid set to coding-style

* make unique-named variables to prevent accidental override and improve readability

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-25 13:20:13 +00:00
Tomas Votruba 5a47e36b72
Add Visibility consts (#4981) 2020-12-24 23:01:30 +01:00
Tomas Votruba 319d6bfca1
add phpstan-for-rector config path, consolidate return type extensions - re-use from Symplify (#4973)
* add phpstan-for-rector config path, to separate phpstan and extensions that help Rector with precise types

* move type value object to value object

* moving

* remove KernelGetContainerAfterBootReturnTypeExtension, use one from symplify

* remove ContainerGetDynamicMethodReturnTypeExtension to ContainerGetReturnTypeExtension

* remove nette extension

* add nette-extension

* removed delegated rule

* delegate implmenets + code sample PHPStan rule to symplify
2020-12-24 16:31:24 +00:00
Tomas Votruba 61e1ceaf5c
Cover ArrayShape type and other doc nodes (#4967)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-23 22:11:37 +01:00