Skip to content

chore: update Rector and PHPStan and apply new Rector rules - #75

Merged
turegjorup merged 2 commits into
developfrom
feature/rector-phpstan-update
Nov 8, 2026
Merged

turegjorup merged 2 commits into
developfrom
feature/rector-phpstan-update

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Update Rector and PHPStan, and apply the new Rector rules. This is step 5 of the quarterly update.

Changes

  • Update the code analysis tools (normal 7-day cooldown):
    • rector/rector 2.5.4 → 2.8.3
    • phpstan/phpstan 2.2.5 → 2.3.4
    • phpstan/phpstan-strict-rules 2.0.11 → 2.1.0
    • phpstan/phpstan-symfony 2.0.20 → 2.1.1
  • Apply the 2 new Rector rules. Both changes give equivalent code:
    • ParamAndEnvAttributeRector in src/Command/ApiKeysAddCommand.php: #[Autowire('%kernel.project_dir%')] becomes #[Autowire(param: 'kernel.project_dir')].
    • DirnameDirConcatStringToDirectStringPathRector in tests/bootstrap.php: dirname(__DIR__).'/vendor/autoload.php' becomes __DIR__.'/../vendor/autoload.php'. The same change applies to .env.

Why

The quarterly update keeps Rector and PHPStan current. New rules change code, so this update is in a separate PR from the dependency update (#74).

PHPStan 2.3 finds no new errors. I generated the baseline again, and it did not change (9 entries). rector.php has no withSkip(), so there are no unknown rules to remove.

Checks

  • PHPStan: no errors. Rector dry-run: no changes.
  • bin/console lint:container: no errors (for the Autowire change).
  • PHP-CS-Fixer: no changes.
  • PHPUnit with coverage on PHP 8.5.12: all tests pass.

Rector 2.8 adds ParamAndEnvAttributeRector and DirnameDirConcatStringToDirectStringPathRector. Both changes are equivalent code. The PHPStan baseline does not change.
@turegjorup turegjorup self-assigned this Nov 8, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.39%. Comparing base (7136c17) to head (9411d3d).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop      #75   +/-   ##
==========================================
  Coverage      74.39%   74.39%           
  Complexity       264      264           
==========================================
  Files             30       30           
  Lines            738      738           
==========================================
  Hits             549      549           
  Misses           189      189           
Flag Coverage Δ
unittests 74.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@turegjorup
turegjorup merged commit 1184242 into develop Nov 8, 2026
13 checks passed
@turegjorup
turegjorup deleted the feature/rector-phpstan-update branch November 8, 2026 20:35
@turegjorup turegjorup mentioned this pull request Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants