repman icon indicating copy to clipboard operation
repman copied to clipboard

Add Rector - Automatic upgrades and code refactoring

Open xvilo opened this issue 3 years ago • 3 comments

This PR aims to add Rector to this project. Rector instantly upgrades and refactors the PHP code of your application. It can help you in 2 major areas:

  • Instant Upgrades (yes, for PHP upgrade PR and Symfony update PR coming later)
  • Automatic Refactoring (e.g. code quality issues and such)

This PR adds some default rules for just PHP Level with LevelSetList::UP_TO_PHP_74. It also automatically imports namespace classes and will remove unused imports too.

The amount of rules/changes could be discussed, but this is the default set delivered by Rector. My intention is to create a PR that updates the project to PHP 8.0, this is includes the upgrades of packages (already available locally) and update to rector so the code will use the latest language features and automatically remove/fix deprecations and such.

xvilo avatar Apr 06 '22 15:04 xvilo

Codecov Report

Merging #579 (800eaeb) into master (c0f2e0d) will increase coverage by 0.00%. The diff coverage is 98.96%.

:exclamation: Current head 800eaeb differs from pull request most recent head 68ef302. Consider uploading reports for the commit 68ef302 to get more accurate results

@@            Coverage Diff            @@
##             master     #579   +/-   ##
=========================================
  Coverage     99.18%   99.19%           
- Complexity     1903     1904    +1     
=========================================
  Files           301      301           
  Lines          6041     5976   -65     
=========================================
- Hits           5992     5928   -64     
+ Misses           49       48    -1     
Impacted Files Coverage Δ
src/Controller/Admin/OrganizationController.php 100.00% <ø> (ø)
src/Entity/Organization/Package/Download.php 100.00% <ø> (ø)
src/Query/Api/Model/Error.php 100.00% <ø> (ø)
src/Query/Api/Model/Errors.php 100.00% <ø> (ø)
src/Query/Api/Model/Links.php 100.00% <ø> (ø)
src/Query/Api/Model/Organization.php 100.00% <ø> (ø)
src/Query/Api/Model/Paginated.php 100.00% <ø> (ø)
src/Service/Config.php 100.00% <ø> (ø)
.../Service/Integration/BitbucketApi/Repositories.php 91.66% <0.00%> (ø)
src/Service/Telemetry/Entry.php 100.00% <ø> (ø)
... and 101 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c0f2e0d...68ef302. Read the comment docs.

codecov[bot] avatar Apr 07 '22 07:04 codecov[bot]

@akondas Can you take some time to get this reviewed?

xvilo avatar Apr 07 '22 07:04 xvilo

Thanks, @marmichalski for your suggestions and comments, I've implemented these as best as I could. Can you do another review of this PR?

xvilo avatar Apr 27 '22 07:04 xvilo