Skip to content

Require container-contract ^1.1 instead of pinning 1.0.4 - #23

Merged
nikolaystrikhar merged 1 commit into
developfrom
fix/relax-container-contract-constraint
Aug 27, 2026
Merged

Require container-contract ^1.1 instead of pinning 1.0.4#23
nikolaystrikhar merged 1 commit into
developfrom
fix/relax-container-contract-constraint

Conversation

@estevao90

@estevao90 estevao90 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description

stellarwp/container-contract has been pinned to an exact 1.0.4 since the initial commit, and
never revisited. That pin is unsatisfiable alongside any package requiring ^1.1.

It's happening with stellarwp/plugin-absorber. It requires the contract at ^1.1 (1.1.0 is
where get() gained the @template/class-string conditional return that lets its PHPStan level 9
type container resolutions), and learndash-core needs both libraries in the same tree.

Why the pin protects nothing

This library touches the contract in exactly one file. src/Config.php type-hints
ContainerInterface on setServiceContainer() / getServiceContainer() and stores it. It never
calls get(), bind(), has() or singleton().

The whole 1.0.4 → 1.1.2 diff on src/ContainerInterface.php is PHPDoc — @template T of object
and @phpstan-return ($id is class-string<T> ? T : mixed) on get(), string|class-string on the
$id params, a corrected @return void on bind() — plus a declare( strict_types=1 ) on a file
that declares an interface and therefore contains no method bodies. No signature changes, so nothing
implementing the interface at 1.0.4 stops implementing it at 1.1.2.

Why ^1.1 and not ^1.0.4

^1.0.4 would have been the smaller change, but ^1.1 is the one worth making: it puts this
library on the generics as well, so a consumer's static analysis gets the same typed get() that
motivated the requirement in plugin-absorber. A consumer that cannot move to 1.1.x simply stays on
1.5.0.

Summary by CodeRabbit

  • Chores
    • Updated a dependency requirement to support compatible 1.1 releases.
    • No user-facing functionality or behavior changes.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Enterprise

Run ID: b27c2fab-41fa-4484-8b53-dd88eddebdf6

📥 Commits

Reviewing files that changed from the base of the PR and between db6177b and b3a96c6.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • composer.json

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The Composer constraint for stellarwp/container-contract changed from exactly 1.0.4 to the compatible ^1.1 range.

Changes

Container contract dependency

Layer / File(s) Summary
Update container contract constraint
composer.json
The dependency constraint changes from 1.0.4 to ^1.1.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to b3a96

This PR updates the container-contract dependency constraint and lockfile without any supplied merge-blocking risk; it is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: updating the stellarwp/container-contract requirement from an exact 1.0.4 pin to ^1.1.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/relax-container-contract-constraint

Comment @coderabbitai help to get the list of available commands.

@estevao90 estevao90 changed the title Chore: require container-contract ^1.1 instead of pinning 1.0.4 Require container-contract ^1.1 instead of pinning 1.0.4 Aug 26, 2026
@nikolaystrikhar
nikolaystrikhar merged commit d6e311b into develop Aug 27, 2026
3 checks passed
@nikolaystrikhar
nikolaystrikhar deleted the fix/relax-container-contract-constraint branch August 27, 2026 09:11
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.

4 participants