1279 Commits

Author SHA1 Message Date
Tomas Votruba
054de822ed
[DoctrineCodeQuality] Add tests (#5540)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-14 19:51:04 +00:00
Abdul Malik Ikhsan
206df09020
[EarlyReturn] Register ReturnAfterToEarlyOnBreakRector to early-return config set (#5542) 2021-02-14 14:40:31 +01:00
Tomas Votruba
d2948833a8
drop unused AddPropertyByParentRector (#5537) 2021-02-13 23:36:53 +00:00
Tomas Votruba
560b720b83
[DependencyInjectoin] Add ActionInjectionToConstructorInjectionRector (#5485) 2021-02-09 22:57:20 +00: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
Abdul Malik Ikhsan
6a6ac8332b
[EarlyReturn] Rename ChangeAndIfContinueToMultiContinueRector to ChangeOrIfContinueToMultiContinueRector (#5483)
* [EarlyReturn] Register ChangeAndIfContinueToMultiContinueRector to early-return config set

* try with clone $if

* [EarlyReturn] Rename ChangeAndIfContinueToMultiContinueRector to ChangeOrIfContinueToMultiContinueRector

* re-register

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* reduce complexity

* [ci-review] Rector Rectify

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-09 22:52:57 +01:00
Abdul Malik Ikhsan
1a9544f5f4
[DeadCode] Register RemoveDeadInstanceOfRector to dead-code config set (#5474)
* [DeadCode] Register RemoveDeadInstanceOfRector to dead-code config set

* failing fixture nullable type

* null type check

* handle child check and null check

* failing fixture with php doc type

* debug

* ensure different var

* fix

* fixture rename

* skip assign as may has side effect

* Param check

* clean up

* clean up

* final touch

* final touch

* fix

* fix

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-09 20:04:20 +01:00
Tomas Votruba
e0ad0f960f
[Tests] Move from getRectorsWithConfiguration() to provideConfigFileInfo() to make test configs more intuitive (#5468)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-09 15:02:29 +01:00
Tomas Votruba
9f6834c46e
[DeadCode] Add RemoveUnusedConstructorParamRector (#5467)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-09 04:55:21 +01:00
Tomas Votruba
fd8fc59ce1
[PHPStanExtensions] Move decoupled KeepRectorNamespaceForRectorRule (#5451) 2021-02-07 21:22:03 +00:00
Abdul Malik Ikhsan
9d78eb02dc
[Symfony 5.2] Rename AbstractRememberMeServices providerKey to firewallName property (#5448) 2021-02-07 18:57:35 +01:00
Tomas Votruba
0c830ab123
misc (#5439) 2021-02-06 22:20:57 +00:00
Abdul Malik Ikhsan
946b1ac84b
[Privatization] Register MakeOnlyUsedByChildrenProtectedRector to privatization config set (#5434)
Co-authored-by: kaizen-ci <info@kaizen-ci.org>
2021-02-06 20:41:44 +01:00
Abdul Malik Ikhsan
760facb75b
[Symfony 5.2] Change Param type declaration for Chat/Email/Sms NotificationInterface (#5420) 2021-02-04 23:46:27 +01:00
Abdul Malik Ikhsan
0e557a5d11
[Symfony 5.2] Change Param type declaration for Notifier and Channel (#5414) 2021-02-03 15:27:12 +01:00
Tomas Votruba
931e233012
[Nette 3.1] Add CallableInMethodCallToVariableRector (#5409) 2021-02-02 14:06:48 +00:00
Tomas Votruba
128e340646
[PHP 7.3] Remove compact checks of unused variable, better migrate in type-safe way (#5396) 2021-01-31 20:39:41 +01:00
Tomas Votruba
e2757242be
Various stabilizations (#5381) 2021-01-30 20:30:37 +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
024ec4ba93
[Generics] Add GenericsPHPStormMethodAnnotationRector (#5365)
Co-authored-by: rector-bot <tomas@getrector.org>
2021-01-29 17:24:20 +01:00
Tomas Votruba
f1a70bd271
[Removing] Move RemoveInterfacesRector here (#5361) 2021-01-29 10:38:59 +00: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
Abdul Malik Ikhsan
e1b1d7db45
[Symfony 5.2] Add ValidatorBuilderEnableAnnotationMappingRector (#5357) 2021-01-29 08:43:08 +01:00
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
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
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
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
Tomas Votruba
485dce60bc
cleanup (#5322) 2021-01-26 09:50:32 +00:00
Tomas Votruba
e00106ee49
[phpstan] Make ComposerRectorInterface child classes respetc the "ComposerRector" suffix (#5319) 2021-01-26 01:32:23 +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
94dce12b29
improts in config (#5315) 2021-01-25 18:26:57 +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
Tomas Votruba
9652382639
[CodeQuality] Add SingularSwitchToIfRector (#5302) 2021-01-24 11:23:50 +00:00
Tomas Votruba
0dc20048ae
Cleanup too detailed order rules + add TypedPropertyFromStrictConstructorRector (#5288) 2021-01-22 18:47:02 +00:00
Richard Kapička
8b64b7a9c0
ConfigSet: Update nette-31 (#5285) 2021-01-22 18:06:48 +01:00
Tomas Votruba
e90a430bcf
[PHP 8.0] Add OptionalParametersAfterRequiredRector (#5277) 2021-01-22 00:17:43 +00:00
vladyslavstartsev
b7977e5c74
[DoctrineCodeQuality] replace ASC|DESC strings with constants (#5271)
* [DoctrineCodeQuality] replace `ASC`|`DESC` strings with constants

* move class definitions to a string
2021-01-21 18:42:03 +01:00
Tomas Votruba
7d001c13b0
Move FlipTypeControlToUseExclusiveTypeRector from type declaration to code-quality-strict, as it might be opinionated and aim at higher level programming (#5265) 2021-01-20 15:24:57 +00:00
Tomas Votruba
f4eb05998b
extend Nette 3.1 set (#5261) 2021-01-20 13:08:23 +00:00
Michal Lulco
f386ccd8ce
Upgrade to Nette 3.1 (#5195) 2021-01-20 12:17:16 +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