Skip to content

Widen dependency constraints for better co-installability#49

Merged
fivefilters merged 2 commits into
masterfrom
claude/readability-dependency-compat-ja8ifr
Jul 18, 2026
Merged

Widen dependency constraints for better co-installability#49
fivefilters merged 2 commits into
masterfrom
claude/readability-dependency-compat-ja8ifr

Conversation

@fivefilters

@fivefilters fivefilters commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Makes it easier to install readability.php into applications whose other dependencies pin different versions of our (transitive) dependencies, without changing the PHP minimum or the versions Composer installs by default.

What changed

  • psr/log: ^2.0 || ^3.0^1.0 || ^2.0 || ^3.0. The library only consumes LoggerInterface (a nullable constructor option and $logger?->debug() calls); it never implements it, so every major works. The anonymous logger in PhpFeaturesTest now uses an untyped log() signature that is valid against all three majors (the previous typed signature fatals under psr/log 1.x).
  • rowbot/url: ^4.1^3.1.7 || ^4.0. rowbot/url 4.1 hard-requires psr/log ^3.0 and brick/math ^0.12 || ^0.13 — both frequent conflict sources in host apps (e.g. older ramsey/uuid pins older brick/math, and the psr/log ^3 requirement made our own ^2.0 alternative unsatisfiable in practice). Allowing 4.0 and 3.1.7 gives Composer's solver room; nothing changes for apps without conflicts, since Composer still resolves to the newest allowed version.
  • CI now runs the test suite against both highest and lowest resolved dependencies (composer update --prefer-lowest --prefer-stable) on PHP 8.4 and 8.5, so the advertised lower bounds stay tested. Psalm still runs on highest only.
  • CHANGELOG: Unreleased entry describing the above.

Verification

Full suite (485 tests, 1080 assertions) plus Psalm run locally on PHP 8.4 (the version that actually exercises rowbot/url — 8.5+ uses native Uri\WhatWg\Url):

Resolution rowbot/url psr/log brick/math Result
highest 4.1.0 3.0.2 0.13.1 ✅ all pass, Psalm clean
pinned 4.0.0 3.0.2 0.9.3 ✅ all pass
pinned 3.1.7 3.0.2 0.9.3 ✅ all pass, Psalm clean
--prefer-lowest 3.1.7 1.0.0 0.8.13 ✅ all pass

Caveat worth deciding on

rowbot/url 3.1.7 emits 10 PHP 8.4 implicit-nullable deprecation notices from its own code when loaded (behavior is unaffected; all tests pass). Since it only loads on PHP 8.4 and only when another dependency forces the downgrade, I kept it in the constraint — maximum solver room. If you'd rather not advertise a version that emits deprecations, trimming to ^4.0 || ^4.1 still captures the brick/math flexibility and is a one-line change.

🤖 Generated with Claude Code

- psr/log: ^1.0 || ^2.0 || ^3.0 — the library only consumes
  LoggerInterface (nullable constructor option, log calls), so every
  major is compatible. Adjust the anonymous logger in the test suite
  to an untyped signature valid against all three majors.
- rowbot/url: ^3.1.7 || ^4.0 — rowbot/url 4.1 hard-requires
  psr/log ^3 and brick/math ^0.12||^0.13, both frequent sources of
  version conflicts in host applications; 4.0 and 3.1.7 accept older
  brick/math (and 3.x drops the psr/log requirement entirely), giving
  Composer's solver room without installing anything extra when no
  conflict exists. The full test suite passes on 4.1.0, 4.0.0 and
  3.1.7 (3.x only ever loads on PHP 8.4; 8.5+ uses native
  Uri\WhatWg\Url).
- CI: run the test suite against both highest and lowest resolved
  dependency versions (composer update --prefer-lowest) so the
  advertised lower bounds stay tested.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CDNFjQwP4iZJiawvGBTZWw
@fivefilters
fivefilters marked this pull request as ready for review July 18, 2026 14:20
Convert the Unreleased section into the v4.0.0 entry. The entry notes
explicitly that v4.0.0 includes all changes from v4.0.0-beta.1 and lists
only the delta since beta.1, keeping the beta's own entry intact for
users who tracked the pre-release.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CDNFjQwP4iZJiawvGBTZWw
@fivefilters
fivefilters merged commit 139133c into master Jul 18, 2026
4 checks passed
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