Repository navigation
Conversation
LazyTo and LazyProvider resolve their target through the injector when the Map is read. Ray\Di\Injector binds a concrete class just in time; CompiledInjector has no script for it and threw Unbound at runtime. Compiler now adds an untargeted binding for each LazyTo/LazyProvider target before building the container, so the target is compiled (and woven) like any bound class. A target that is already bound is left as is. The target class is private in Ray.Di, so it is read by reflection. Fixes #148
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #152 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 118 124 +6
===========================================
Files 12 12
Lines 302 312 +10
===========================================
+ Hits 302 312 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ing it Ray.Di 2.24 deprecates just-in-time binding of an unbound concrete class and asks for an explicit binding (ray-di/Ray.Di#337), and promises that a passing compile leaves no JIT dependency. Compiling an unbound LazyTo/LazyProvider target would accept the deprecated form only under CompiledInjector. Compiler now throws Unbound for such a target before compiling, so the failure surfaces at build time.
# Conflicts: # CHANGELOG.md
|
@coderabbitai review — merged 1.x (CHANGELOG conflict) and added a composer |
Analysis chain
Action not completed
|
…e with ray/compiler
|
@coderabbitai review — cb9215c adds |
Analysis chain
In I’ll request a review of the changes. Action performed
|
Fixes #148
MultiBinder::addBinding()->to(X::class)/->toProvider(P::class)without bindingX/Pcompiled, then threwUnboundwhen theMapwas read underCompiledInjector.Ray\Di\Injectorresolves it only through just-in-time binding, which Ray.Di 2.24 deprecates in favour of an explicit binding (ray-di/Ray.Di#337).compile()now throwsUnboundfor such a target, so the failure surfaces at build time and a passing compile leaves no JIT dependency.$this->bind(X::class).LazyTo/LazyProvider(unchanged from 2.19 to 2.24), so it is read withReflectionProperty.Summary by CodeRabbit
Unbounderror when a multibinding target declared withto()ortoProvider()has not been bound. The error identifies the missing target, including when it has only a qualified binding.composer.jsonconflicts with bear/qiq-module 2.1.0–2.1.2 and madapaja/twig-module 2.8.0, which add their compile step as a multibinding target without binding it (fixed in Bind QiqCompileStep explicitly bearsunday/BEAR.QiqModule#50).