Closed frederikbosch closed 5 years ago
The PR is finished in the sense that it fixed #160. The syntax to use contextual binding is as follows.
$di->params[D::class]['param'] = $di->lazyNew(B::class)->withContext(new Blueprint(C::class, ['name' => 'second']));
This consists of some optimizations.
Blueprint
. It contains all the specific params/setters/mutations for the class to be instantiated. Before, two class did the same thing.Resolver
to be moved into the Blueprint
. This results in a more dedicated Resolver
class.LazyInterface
instances are resolved in the final stage of instantiating the objectTravis fails due to nightly
is PHP 8.0.0 already, and PHPUnit requires 7.x.
Tests fixed
I’d be very happy if there could be some feedback. Then we can move to an alpha stage maybe.
@harikt Are you OK to merge this in? I stashed the PR, added docs.
I will check it on the coming days.
@frederikbosch I am good with this.
params
,setters
,mutations
and sooncontextualParams
to aBlueprint
class