485 Commits

Author SHA1 Message Date
Tomas Votruba
9beb1da3c0
Move fixture requirement from command line to a test case (#5832) 2021-03-13 15:07:31 +01:00
Tomas Votruba
ab1154f6c8
[CI] Drop fixture checks, that are now covered by static reflection (#5831) 2021-03-13 11:47:11 +01:00
Matthias Pigulla
5677e7caef
Don't abort building Docker images when one variant fails (#5830) 2021-03-13 11:29:44 +01: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
TomasVotruba
eb80d1a48b bump master branch to main 2021-03-11 21:29:21 +01:00
Tomas Votruba
1cbb6113fc
[CI] remove changelog linker (#5803) 2021-03-08 19:50:03 +00:00
Abdul Malik Ikhsan
e362a516c2
[changelog] remove CHANGELOG.md first before run composer changelog on weekly composer changelog (#5790)
It seems automatic PR https://github.com/rectorphp/rector/pull/5789 doesn't generate tag header like manual delete and re-create at https://github.com/rectorphp/rector/pull/5719 . 

This ensure CHANGELOG.md re-generated by remove it first.
2021-03-07 12:39:52 +01:00
TomasVotruba
273e1d2974 [CI] make PHP 7.1 build inactive untill it get fixed from static reflection 2021-03-05 01:30:51 +01:00
Jan Mikeš
ab8a1e517d
[Docker] Setup QEMU for multiarch builds (#5774) 2021-03-04 14:40:51 +01:00
Jan Mikeš
7e131b91c9
[Docker] Support multiple CPU architectures - arm64 + amd64 (#5773) 2021-03-04 13:51:33 +01:00
Matthias Pigulla
a2bebbed5c
Generate Docker tags in more efficient way (#5732) 2021-03-04 11:37:42 +01:00
Tomas Votruba
382f146eaf
Merge CoreRectorInterface (#5762) 2021-03-03 22:28:27 +01:00
Tomas Votruba
c1dab30664
[MockistaToMockery] Drop as mockista is completely dead package (#5758) 2021-03-03 18:40:45 +01:00
Jan Mikeš
f3cdb06adf
Drop no longer needed secured rector version of Docker image (#5759) 2021-03-03 17:37:59 +00:00
Tomas Votruba
b7b6725364
remove abstract (#5736) 2021-03-03 08:49:57 +00:00
Tomas Votruba
3673e2182c
[StaticReflection] Add OptimizedDirectorySourceLocator to speedup directory analysis (#5727)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-03-02 23:42:53 +00:00
Jan Mikeš
013c7c7ca3
[CI][Docker] Fix missing image when tagging (#5731) 2021-03-02 15:27:07 +01:00
Jan Mikeš
f7b65a09b2
[CI][Docker] Merge Docker image tagging jobs (#5730) 2021-03-02 15:20:34 +01:00
Jan Mikeš
00833e1ca1
Allow failure of pushing additional tags (#5729) 2021-03-02 15:06:13 +01:00
Jan Mikeš
85298cfff7
Add additional tags on Docker images based on git ref (#5726) (#5728) 2021-03-02 14:59:33 +01: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
Jan Mikeš
66f6b4a573
Fix name of Docker image (#5726) 2021-03-02 14:31:45 +01:00
Matthias Pigulla
ff93a759e6
Build "scoped" Docker images in GitHub Actions (#5667)
* Improve GHA build process to provide scoped Docker images for PHP 7.3-8.0

* Push cached build layers to Docker Hub instead of ghcr.io

* Build "-secured" Docker image

* Run Docker publish workflow for the "experimental-scoped" branch

* Use "plain" progress output from buildx

* Build only one image named "secured", based on PHP 8.0
2021-03-02 14:25:39 +01:00
Tomas Votruba
11dab764e6
[PHPStanStaticTypeMapperChecker] Drop as very limited testing benefit, overly protective (#5721) 2021-03-02 11:22:49 +00:00
Abdul Malik Ikhsan
9576d65326
[Rector-CI] Update EndBug/add-and-commit to v7.0.0 (#5700) 2021-02-28 10:32:21 +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
9f4353c2af
[Coverage] Delete weekly coverage generation (#5631)
* [Coverage] Delete weekly coverage generation

* remove coverage badge
2021-02-20 17:41:38 +00:00
Abdul Malik Ikhsan
3cb9fc28b3
[Coverage] Add --testdox to phpunit command on weekly code coveage generation (#5630) 2021-02-20 14:38:40 +00:00
Tomas Votruba
652459ad3b
merge composer_validate (#5620) 2021-02-19 01:36:48 +01:00
Abdul Malik Ikhsan
4674e57a9f
Revert "[PHP 7.1 Scoped] Use PHP 7.1 for build php 7.1 (#5562)" (#5563)
This reverts commit 642110750f6a39e6d6483d103e49aedb78d6f444.
2021-02-15 19:34:21 +00:00
Tomas Votruba
1d80ef3df6
[TypeDeclaration] Add external types to ParamTypeFromStrictTypedPropertyRector (#5560) 2021-02-15 19:31:53 +00:00
Abdul Malik Ikhsan
642110750f
[PHP 7.1 Scoped] Use PHP 7.1 for build php 7.1 (#5562) 2021-02-15 19:20:20 +00:00
Abdul Malik Ikhsan
4fa3573dff
[PHP 7.1 Scoped] install dev dependency as well to allow run phpunit (#5561)
* [PHP 7.1 Scoped] install dev dependency as well to allow run phpunit
2021-02-15 18:51:26 +00:00
Abdul Malik Ikhsan
1fce3e00f8
[PHP 7.1 Scoped] Replace composer.json with autoload/require with the base composer.json (#5550) 2021-02-15 08:52:24 +00:00
Jan Mikeš
2ac7b5e12b
[CI][Docker] Push all Docker image tags at once (#5531) 2021-02-13 17:58:29 +01:00
TomasVotruba
d81489ea91 [CI] run only single scoping for tagged/non-tagged 2021-02-11 13:37:40 +01:00
Abdul Malik Ikhsan
ee0afabfc4
[PHP 7.1 Scoped] remove stubs from excluded zip at build_php71.yaml (#5489)
refs https://github.com/rectorphp/rector-php71/pull/1#discussion_r573557883
2021-02-10 11:57:24 +01:00
Tomas Votruba
b9f5fe2f3d
[CI] Add PHP 8.0 php linter (#5479) 2021-02-09 21:32:17 +01:00
Tomas Votruba
ecbef2bcaa
[Tests] remove getPhpVersion() helped method, use configs instead (#5477) 2021-02-09 17:25:16 +00:00
Tomas Votruba
1757e83cdc
misc, remove RemoveProjectFileRector (#5463) 2021-02-08 18:26:00 +00:00
TomasVotruba
9b452a214a use master branch as common 2021-02-07 23:18:57 +01: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
TomasVotruba
e9b9d789b5 [ci] use united bot name 2021-01-31 15:26:44 +01:00
Tomas Votruba
4590b10b43
[Process] Add --no-diffs for better huge CI debug (#5368) 2021-01-29 20:12:09 +00:00
Abdul Malik Ikhsan
4ce73a2867
[NodeTypeResolver] Handle PropertyFetchTypeResolver on PropertyProperty resolution (#5334)
Co-authored-by: Vašek Henzl <vasek.henzl@gmail.com>
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-27 17:00:42 +01:00
Abdul Malik Ikhsan
6f17c9c114
Apply build_php_71 workflow only in push (#5327) 2021-01-26 17:59:22 +01: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