11009 Commits

Author SHA1 Message Date
Tomas Votruba
74aa0292c0
[ActionInjectionToConstructorInjectionRector] Deprecate for nishes market (#5356) 2021-01-29 00:36:01 +00:00
Tomas Votruba
1f61ef7160
[Generic] specialize generic rules (#5355) 2021-01-29 00:29:12 +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
a4ed7222f3
Refactor AbstractPHPUnitRector to composition (#5353) 2021-01-28 21:24:00 +00:00
Tomas Votruba
f9fdf2caaf
decopule AbstractTemporaryRector that does not requires rule definition (#5352)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-28 19:52:11 +00:00
Tomas Votruba
f9f12d9109
[Symfony 5.1] Add LogoutHandlerToLogoutEventSubscriberRector (#5346) 2021-01-28 18:55:35 +00:00
Tomas Votruba
8e3e3fd6e1
add CoreRectorInterface and PhpCoreRectorInterface to allow PhpRectorInterface to be RectorInterface without getDefinition() (#5348) 2021-01-28 19:26:56 +01:00
Abdul Malik Ikhsan
92fef472e4
[PHP 5.5] Move ClassConstantToSelfClassRector from Php 7.4 to Php 5.5 set (#5347) 2021-01-28 16:02:34 +00:00
Michal Lulco
695b16ccf1
Fixed case sensitivity for SetList (#5345) 2021-01-28 16:48:39 +01:00
Abdul Malik Ikhsan
85af424e23
[PHPStan] Typo fix: Refator -> Refactor (#5344) 2021-01-28 16:48:01 +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
Abdul Malik Ikhsan
f515c8e3b2
[DeadCode] Typo Fix Imlemented -> Implemented (#5336) 2021-01-27 17:01:38 +01: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
Tomas Votruba
8fa21a8cb0
[Renaming] Add RenameStringRector (#5335)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-27 15:31:55 +01:00
Tomas Votruba
fced0ca087
[Symfony] Add Symfony 5.1 set (#5331)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-27 15:09:08 +01:00
Abdul Malik Ikhsan
57d7899184
[Symfony 5.2] Upgrade Definition/Alias::setPrivate to setPublic (#5325) 2021-01-27 14:15:57 +01:00
Abdul Malik Ikhsan
453b8ba0b8
[Doctrine] Skip ServiceEntityRepositoryParentCallToDIRector on non __construct method (#5333)
Co-authored-by: Dominik Firla <dominik.firla@carvago.com>
2021-01-27 14:13:27 +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
485dce60bc
cleanup (#5322) 2021-01-26 09:50:32 +00:00
Abdul Malik Ikhsan
6ff43c3d7a
[TypeDeclaration] Skip ReturnTypeDeclarationRector when class parent extends is in 'vendor' (#5308)
Co-authored-by: Martin <admin@phpcode.eu>
2021-01-26 10:04:36 +01:00
Tomas Votruba
00d6c60ab1
[ComposerRector] Remove unused MovePackageToRequireComposerRector and MovePackageToRequireDevComposerRector rules (#5321) 2021-01-26 02:51:31 +01:00
Tomas Votruba
e00106ee49
[phpstan] Make ComposerRectorInterface child classes respetc the "ComposerRector" suffix (#5319) 2021-01-26 01:32:23 +00:00
Tomas Votruba
9c26ebf430
static fixes (#5317) 2021-01-25 19:52:41 +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
8d600ce412
[docs] regenerate (#5316) 2021-01-25 18:59:06 +00:00
Tomas Votruba
94dce12b29
improts in config (#5315) 2021-01-25 18:26:57 +00:00
Tomas Votruba
2073fda6c3
add misisng post suffix to NodeRemovingPostRector (#5314) 2021-01-25 18:07:05 +00: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
f489a4ab6b
remove OrderConstructorDependenciesByTypeAlphabeticallyRector, not used (#5312) 2021-01-25 17:20:21 +00:00
Abdul Malik Ikhsan
8767a57040
[DeadCode] Skip RemoveUnusedPublicMethodRector for all magic methods (#5311) 2021-01-25 17:51:56 +01:00
Tomas Votruba
a0f7656b68
[RemoveAnnotationRector] Add node type support, merge JMS removal rules (#5310) 2021-01-25 16:20:05 +00:00
Tomas Votruba
dba5b8d714
[PHP 7.2] Fix GetClassOnNullRector for self nullable (#5306) 2021-01-25 01:14:11 +00:00
Tomas Votruba
53835a751e
[PHP 7.1] Fix AssignArrayToStringRector for dynamic property fetch names (#5305) 0.9.16 2021-01-24 21:43:15 +00:00
Tomas Votruba
94dedf4bb3
[PHP 7.0] Update self in final class (#5304) 2021-01-24 20:12:02 +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
13380b5b16
[CodeQuality] Make ArrayThisCallToThisMethodCallRector private class method (#5303) 2021-01-24 12:56:35 +00:00
Tomas Votruba
9652382639
[CodeQuality] Add SingularSwitchToIfRector (#5302) 2021-01-24 11:23:50 +00:00
Tomas Votruba
0e2da52ee8
[TypeDeclaration] Fix return array strict (#5300) 2021-01-24 09:15:16 +00:00
Abdul Malik Ikhsan
2b49b712bd
[Code Coverage] Fixes weekly code coverage generation (#5298)
* [Code Coverage] Fixes weekly code coverage generation Fixes #5297

* rclean up should already handled by GA
2021-01-24 10:07:42 +01:00
github-actions[bot]
ad256edcad
[automated] Re-Generate Nodes/Rectors Documentation (#5296)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2021-01-24 10:07:23 +01:00
github-actions[bot]
9f9ed8f960
[automated] Re-Generate CHANGELOG.md (#5295)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
2021-01-24 10:06:47 +01:00
Abdul Malik Ikhsan
c5132286f8
[PHP 5.6] Handle empty array initialization for Undefined array in AddDefaultValueForUndefinedVariableRector (#5293)
* Add failing test fixture for AddDefaultValueForUndefinedVariableRector

# Failing Test for AddDefaultValueForUndefinedVariableRector

Based on https://getrector.org/demo/62ab1e88-6035-4fa6-87bb-c600dac418b2

* Closes #5260 Fixes #5253

* fixture name

* phpstan

* clean up

* [ci-review] Rector Rectify

Co-authored-by: vladyslavstartsev <17382248+vladyslavstartsev@users.noreply.github.com>
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-23 18:05:33 +01:00
Abdul Malik Ikhsan
92acc4a490
[Printer] Remove AnnotationFormatRestorer and ContentPatcher (#5294) 2021-01-23 18:05:13 +01:00
vladyslavstartsev
10b96a0b97
Make example of ReplaceStringWithClassConstantRector more correct (#5269)
* Make example of ReplaceStringWithClassConstantRector more correct

- `argument position` and `class with constants` are swapped
- `argument position` starts with zero (0), so `1` is the second argument

* also fix example in `Rector`ing class
2021-01-23 14:51:23 +02:00
Abdul Malik Ikhsan
8cd6dbea3b
[TypeDeclaration] Skip ParamTypeDeclarationRector on interface with extends (#5292)
* Add failing test fixture for ParamTypeDeclarationRector

# Failing Test for ParamTypeDeclarationRector

Based on https://getrector.org/demo/56b352cf-6ba5-4fd5-8186-dd071d1e4010

* Fix namespace position

* Update rules/type-declaration/tests/Rector/FunctionLike/ParamTypeDeclarationRector/Fixture/vat_rate.php.inc

Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>

* Update rules/type-declaration/tests/Rector/FunctionLike/ParamTypeDeclarationRector/Fixture/vat_rate.php.inc

Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>

* Update interfaces' names

* Rename vat_rate.php.inc to skip_different_with_interface.php.inc

* Close #5274 Fixes #5270

* cs fix

Co-authored-by: Adamo Crespi <hello@aerendir.me>
2021-01-23 12:38:30 +01:00
Tomas Votruba
d08f63fb1b
[RemovingStatic] Keep static if required by parent contract (#5291) 2021-01-23 09:46:25 +00:00
TomasVotruba
e714623b95 fix cs 2021-01-23 01:15:57 +01:00
Tomas Votruba
87072b597d
PHP 7.4 8 typo (#5290) 2021-01-22 23:11:10 +00:00
TomasVotruba
1aac87f335 [PHP 8.0] Remove useless var 2021-01-22 20:22:51 +01:00