Skip to content

chore: require all directly used packages - #73

Merged
turegjorup merged 3 commits into
developfrom
feature/direct-dependencies
Nov 8, 2026
Merged

turegjorup merged 3 commits into
developfrom
feature/direct-dependencies

Conversation

@turegjorup

@turegjorup turegjorup commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Require all packages that the code uses directly, and let PHPStan check this. This is step 3 of the quarterly update.

Changes

  • Add pb30/phpstan-composer-analysis (^1.1) to require-dev. Configure it in phpstan.dist.neon with the same settings as event-database-imports (chore: require all directly used packages event-database-imports#117), without additionalDevPaths.
  • Add the 10 packages that the code uses directly, but that were only installed as transitive dependencies. Each constraint agrees with the installed version:
    • psr/container ^2.0
    • symfony/dependency-injection, symfony/http-foundation, symfony/http-kernel, symfony/routing, symfony/security-core, symfony/security-http, symfony/string, symfony/type-info ~7.4.0
    • symfony/http-client-contracts ^3.7
  • composer.lock adds only pb30/phpstan-composer-analysis and shipmonk/composer-dependency-analyser. No installed version changes.

Why

The quarterly update runs composer update --with-all-dependencies. A package that is only a transitive dependency can then get a new major version that nobody chose. With the packages in composer.json, Composer keeps them in the given versions.

The PHPStan check fails in CI if new code uses a package that is not in composer.json.

Checks

  • PHPStan: no errors. Rector dry-run: no changes.
  • composer validate --strict and composer normalize --dry-run: no problems.
  • PHPUnit on PHP 8.5.12: all tests pass.

Add pb30/phpstan-composer-analysis to report packages used directly but only installed transitively, and add the 10 missing requirements at their installed versions. composer.lock adds only the analysis packages.
@codecov-commenter

codecov-commenter commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             develop      #73   +/-   ##
==========================================
  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 7b81afa into develop Nov 8, 2026
10 of 12 checks passed
@turegjorup
turegjorup deleted the feature/direct-dependencies branch November 8, 2026 20:25
@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