831 Commits

Author SHA1 Message Date
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